separate group check and staff check

This commit is contained in:
james1293 2019-07-23 11:01:36 -04:00
parent d1b1fe1433
commit f1c2c4c89f

View file

@ -17,7 +17,9 @@ def del_list(request, list_id: int, list_slug: str) -> HttpResponse:
# Ensure user has permission to delete list. Get the group this list belongs to,
# and check whether current user is a member of that group AND a staffer.
if not (task_list.group in request.user.groups.all() and request.user.is_staff):
if task_list.group not in request.user.groups.all():
raise PermissionDenied
if not request.user.is_staff:
raise PermissionDenied
if request.method == "POST":