From 7f7debbe0d5d5bbbe4182207137b651be100e408 Mon Sep 17 00:00:00 2001 From: Matthew Lemon Date: Wed, 16 Oct 2024 10:06:37 +0100 Subject: Fixes miss-named list view function --- instruments/tests/test_views.py | 2 +- instruments/views.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'instruments') diff --git a/instruments/tests/test_views.py b/instruments/tests/test_views.py index 048ab47..e1573a2 100644 --- a/instruments/tests/test_views.py +++ b/instruments/tests/test_views.py @@ -7,4 +7,4 @@ pytestmark = pytest.mark.django_db def test_view_url_exists_at_desired_location(client): url = reverse("instruments:sop-list") response = client.get(url) - assert response.status_code == 200 + assert response.status_code == 302 diff --git a/instruments/views.py b/instruments/views.py index 0329e00..37ec69f 100644 --- a/instruments/views.py +++ b/instruments/views.py @@ -1,10 +1,11 @@ # from django.shortcuts import render +from django.contrib.auth.mixins import LoginRequiredMixin from django.views.generic.list import ListView from .models import SOP -class SOPListView(ListView): +class SOPListView(LoginRequiredMixin, ListView): model = SOP paginate_by = 100 -- cgit v1.2.3