diff --git a/submissions/forms.py b/submissions/forms.py index 8af0d630a1c2bc6519a062a4b057f503a31e42a0..69170e20549a616b85a50c01a968eeceb9332d41 100644 --- a/submissions/forms.py +++ b/submissions/forms.py @@ -225,7 +225,7 @@ class SubmissionPrefillForm(forms.Form): # Resubmission self.latest_submission = Submission.objects.filter( thread_hash=self.thread_hash).order_by( - '-submission_date', '-preprint__vn_nr').first() + '-submission_date', '-preprint').first() else: self.latest_submission = None super().__init__(*args, **kwargs) diff --git a/submissions/models/submission.py b/submissions/models/submission.py index 8cbe1640fd17c8e13649e30baecf8c17a6b1a82f..8c3fe880d75089cfe5aeafd085b5e1db1d267c17 100644 --- a/submissions/models/submission.py +++ b/submissions/models/submission.py @@ -331,7 +331,7 @@ class Submission(models.Model): def thread(self): """Return all (public) Submissions in the database in this thread.""" return Submission.objects.public().filter(thread_hash=self.thread_hash).order_by( - '-submission_date', '-preprint__vn_nr') + '-submission_date', '-preprint') @property def thread_sequence_order(self): @@ -341,7 +341,7 @@ class Submission(models.Model): @cached_property def other_versions(self): """Return other Submissions in the database in this thread.""" - return self.get_other_versions().order_by('-submission_date', '-preprint__vn_nr') + return self.get_other_versions().order_by('-submission_date', '-preprint') def get_other_versions(self): """Return queryset of other Submissions with this thread."""