add user_user support to atlas collections

This commit is contained in:
Ross
2023-07-03 13:06:08 +01:00
parent 15b6233802
commit c799f106d7
9 changed files with 160 additions and 90 deletions
+6 -2
View File
@@ -470,12 +470,14 @@ class ExamCollectionGenericBase(models.Model):
if c:
return c
if user_user is not None:
elif user_user is not None:
c = CidUserExam.objects.filter(
content_type=content_type, object_id=self.pk, user_user=user_user
).first()
if c:
return c
else:
raise ValueError("Invalid cid / cid_user / user_user")
if start_time is None:
start_time = timezone.now()
@@ -488,13 +490,15 @@ class ExamCollectionGenericBase(models.Model):
start_time=start_time,
)
if user_user is not None:
elif user_user is not None:
new = CidUserExam(
content_type=content_type,
object_id=self.pk,
user_user=user_user,
start_time=start_time,
)
else:
raise ValueError("Invalid cid / cid_user / user_user")
new.save()
return new