From dd77ee6c42b4d900daf1627fad93359d2786245d Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Sat, 1 May 2021 12:14:58 +0200
Subject: [PATCH] Remove deprecated vn_nr from preprint ordering

---
 submissions/forms.py             | 2 +-
 submissions/models/submission.py | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/submissions/forms.py b/submissions/forms.py
index 8af0d630a..69170e205 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 8cbe1640f..8c3fe880d 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."""
-- 
GitLab