This commit is contained in:
Ross
2024-11-04 14:09:33 +00:00
parent d8b07449a4
commit eab6fc9d7e
8 changed files with 35 additions and 10 deletions
+2 -1
View File
@@ -702,7 +702,7 @@ class ExamOrCollectionGenericBase(models.Model, AuthorMixin):
allow_authors: bool = True,
):
"""Checks if a user (cid or otherwise) is allowed to access (and take) the exam"""
print(f"Check cid user: {cid=}, {passcode=}, exam_id={self.pk}")
print(f"Check cid user: {cid=}, {passcode=}, exam_id={self.pk}, {user=}, {user_id=}, {allow_authors=}")
if user is not None and user.is_superuser:
return True
@@ -724,6 +724,7 @@ class ExamOrCollectionGenericBase(models.Model, AuthorMixin):
return False
# Start by checking if the logged in user can access
if user_id is not None:
if self.valid_user_users.filter(pk=user_id).exists():