From 298493a390826dde6aa5408b3f816c818478a3c3 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 15 Sep 2025 11:34:17 +0100 Subject: [PATCH] Remove redundant author validation check in collection_take_start and streamline access control in ExamOrCollectionGenericBase --- atlas/views.py | 4 ---- generic/models.py | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/atlas/views.py b/atlas/views.py index 8ba8d18b..83ecb58b 100755 --- a/atlas/views.py +++ b/atlas/views.py @@ -2125,10 +2125,6 @@ def collection_take_start(request, pk, cid=None, passcode=None): valid_user = False #valid_user = collection.check_logged_in_user(request) - if not valid_user and collection.is_author(request.user): - valid_user = True - - cid_exam = None if collection.collection_type == "REV" or valid_user: diff --git a/generic/models.py b/generic/models.py index 5685c0a4..766c02d7 100644 --- a/generic/models.py +++ b/generic/models.py @@ -768,6 +768,9 @@ class ExamOrCollectionGenericBase(models.Model, AuthorMixin): Raises: Http404: If user does not have access """ + if user is not None and self.is_author(user): + return + # If we are limiting by dates check that the current date is within the range if self.restrict_to_dates: if self.start_date >= timezone.now() or (