.
This commit is contained in:
+2
-1
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user