Skip to content

Commit c02752d

Browse files
committed
Changed a draft submission revision consistency check to look at Submission objects rather than SubmissionDocEvent objects in order to not fail incorrectly when there are prior cancelled uploads. Related to issue ietf-tools#2909.
- Legacy-Id: 18586
1 parent 8f48854 commit c02752d

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

ietf/submit/utils.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,9 @@ def check_submission_revision_consistency(submission):
170170
171171
Returns None if revision is consistent or an error message describing the problem.
172172
"""
173-
unexpected_events = SubmissionDocEvent.objects.filter(
174-
submission__name=submission.name, rev__gte=submission.rev
175-
)
176-
if len(unexpected_events) != 0:
177-
conflicts = [evt.rev for evt in unexpected_events]
173+
unexpected_submissions = Submission.objects.filter(name=submission.name, rev__gte=submission.rev, state_id='posted').order_by('rev')
174+
if len(unexpected_submissions) != 0:
175+
conflicts = [sub.rev for sub in unexpected_submissions]
178176
return "Rev %s conflicts with existing %s (%s). This indicates a database inconsistency that requires investigation." %(
179177
submission.rev,
180178
"submission" if len(conflicts) == 1 else "submissions",

0 commit comments

Comments
 (0)