diff --git a/tin/apps/assignments/tests/test_file_actions.py b/tin/apps/assignments/tests/test_file_actions.py index aded3a11..2b68a54d 100644 --- a/tin/apps/assignments/tests/test_file_actions.py +++ b/tin/apps/assignments/tests/test_file_actions.py @@ -8,16 +8,14 @@ @login("teacher") -def test_choose_file_action_view(client, course, file_action) -> None: +def test_manage_file_actions_view(client, course, file_action) -> None: # make sure the view works - response = client.get(reverse("assignments:choose_file_action", args=[course.id])) + url = reverse("assignments:manage_file_actions", args=[course.id]) + response = client.get(url) assert response.status_code == 200 file_action.courses.clear() - response = client.post( - reverse("assignments:choose_file_action", args=[course.id]), - {"file_action": file_action.id}, - ) + response = client.post(url, {"file_action": file_action.id}) assert file_action.courses.filter(id=course.id).exists() diff --git a/tin/apps/assignments/urls.py b/tin/apps/assignments/urls.py index 9b8d3383..6e41fefe 100644 --- a/tin/apps/assignments/urls.py +++ b/tin/apps/assignments/urls.py @@ -25,9 +25,9 @@ name="delete_file", ), path( - "/files/actions/choose", - views.choose_file_action, - name="choose_file_action", + "/files/actions/manage", + views.manage_file_actions, + name="manage_file_actions", ), path( "/files/actions/choose/new", diff --git a/tin/apps/assignments/views.py b/tin/apps/assignments/views.py index d5b657b1..455dc649 100644 --- a/tin/apps/assignments/views.py +++ b/tin/apps/assignments/views.py @@ -481,8 +481,13 @@ def file_action_view(request, assignment_id, action_id): @teacher_or_superuser_required -def choose_file_action(request, course_id: int): - """Choose a file action template.""" +def manage_file_actions(request, course_id: int): + """Add, remove and edit :class:`.FileAction`s for a :class:`.Course` + + Args: + request: The request + course_id: The primary key of the :class:`.Course` + """ course = get_object_or_404( Course.objects.filter_editable(request.user), id=course_id, @@ -500,12 +505,12 @@ def choose_file_action(request, course_id: int): course_actions = course.file_actions.all() return render( request, - "assignments/choose_file_action.html", + "assignments/manage_file_actions.html", { "actions": actions, "course_actions": course_actions, "course": course, - "nav_item": "Choose file action", + "nav_item": "Manage file actions", }, ) diff --git a/tin/templates/assignments/choose_file_action.html b/tin/templates/assignments/manage_file_actions.html similarity index 90% rename from tin/templates/assignments/choose_file_action.html rename to tin/templates/assignments/manage_file_actions.html index 80c195cc..002606ae 100644 --- a/tin/templates/assignments/choose_file_action.html +++ b/tin/templates/assignments/manage_file_actions.html @@ -6,7 +6,7 @@