feat: 'fix' last submission when submission types change
This commit is contained in:
parent
f8f95db5c3
commit
50d189d8ed
|
@ -1 +1 @@
|
||||||
__version__ = "2025.2.0"
|
__version__ = "2025.3.0.dev0"
|
||||||
|
|
|
@ -39,15 +39,14 @@ def get_last_submission(settings, submissions, submission=None):
|
||||||
if submission is not None and submission.state != SubmissionStates.SUBMITTED:
|
if submission is not None and submission.state != SubmissionStates.SUBMITTED:
|
||||||
submission = None
|
submission = None
|
||||||
|
|
||||||
return (
|
submissions = submissions.filter(
|
||||||
submission
|
|
||||||
or submissions.filter(
|
|
||||||
submission_type__in=settings.submission_types.all(),
|
submission_type__in=settings.submission_types.all(),
|
||||||
state=SubmissionStates.SUBMITTED,
|
state=SubmissionStates.SUBMITTED,
|
||||||
)
|
)
|
||||||
.order_by("created")
|
if submission is not None and not submissions.filter(pk=submission.pk).exists():
|
||||||
.first()
|
submission = None
|
||||||
)
|
|
||||||
|
return submission or submissions.order_by("created").first()
|
||||||
|
|
||||||
|
|
||||||
class JoinView(TemplateView):
|
class JoinView(TemplateView):
|
||||||
|
|
Loading…
Reference in New Issue