Remove redundant author validation check in collection_take_start and streamline access control in ExamOrCollectionGenericBase

This commit is contained in:
Ross
2025-09-15 11:34:17 +01:00
parent de8050a8ca
commit 298493a390
2 changed files with 3 additions and 4 deletions
-4
View File
@@ -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:
+3
View File
@@ -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 (