Update views.py
Fix MultipleObjects error that happens if you have multiple lists of the same name and you delete one.
This commit is contained in:
parent
cb7b4e4c1f
commit
c41d15344b
1 changed files with 1 additions and 1 deletions
|
@ -83,7 +83,7 @@ def list_lists(request) -> HttpResponse:
|
|||
def del_list(request, list_id: int, list_slug: str) -> HttpResponse:
|
||||
"""Delete an entire list. Danger Will Robinson! Only staff members should be allowed to access this view.
|
||||
"""
|
||||
task_list = get_object_or_404(TaskList, slug=list_slug)
|
||||
task_list = get_object_or_404(TaskList, id=list_id)
|
||||
|
||||
# Ensure user has permission to delete list. Admins can delete all lists.
|
||||
# Get the group this list belongs to, and check whether current user is a member of that group.
|
||||
|
|
Loading…
Reference in a new issue