Get task_list before checking for groups
This commit is contained in:
parent
439689b32e
commit
7e0435a948
1 changed files with 1 additions and 1 deletions
|
@ -106,9 +106,9 @@ def list_detail(request, list_id=None, list_slug=None, view_completed=False):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Show a specific list, ensuring permissions.
|
# Show a specific list, ensuring permissions.
|
||||||
|
task_list = get_object_or_404(TaskList, id=list_id)
|
||||||
if task_list.group not in request.user.groups.all() and not request.user.is_staff:
|
if task_list.group not in request.user.groups.all() and not request.user.is_staff:
|
||||||
raise PermissionDenied
|
raise PermissionDenied
|
||||||
task_list = get_object_or_404(TaskList, id=list_id)
|
|
||||||
items = Item.objects.filter(task_list=task_list.id)
|
items = Item.objects.filter(task_list=task_list.id)
|
||||||
|
|
||||||
# Additional filtering
|
# Additional filtering
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue