When converting submission events to doc events, post them in chronological order. Don't add upload doc events until we're past the possibility of submission cancellation.
- Legacy-Id: 12097
This commit is contained in:
parent
5612a3f463
commit
8a5593e714
|
@ -140,7 +140,8 @@ def docevent_from_submission(request, submission, desc, who=None):
|
|||
def post_rev00_submission_events(draft, submission, submitter):
|
||||
# Add previous submission events as docevents
|
||||
# For now we'll filter based on the description
|
||||
for subevent in submission.submissionevent_set.all():
|
||||
events = []
|
||||
for subevent in submission.submissionevent_set.all().order_by('id'):
|
||||
desc = subevent.desc
|
||||
if desc.startswith("Uploaded submission"):
|
||||
desc = "Uploaded new revision"
|
||||
|
@ -168,6 +169,8 @@ def post_rev00_submission_events(draft, submission, submitter):
|
|||
e.by = submitter
|
||||
e.desc = desc
|
||||
e.save()
|
||||
events.append(e)
|
||||
return events
|
||||
|
||||
|
||||
def post_submission(request, submission, approvedDesc):
|
||||
|
@ -218,7 +221,7 @@ def post_submission(request, submission, approvedDesc):
|
|||
|
||||
if draft.rev == '00':
|
||||
# Add all the previous submission events as docevents
|
||||
post_rev00_submission_events(draft, submission, submitter)
|
||||
events += post_rev00_submission_events(draft, submission, submitter)
|
||||
|
||||
# Add an approval docevent
|
||||
e = DocEvent.objects.create(
|
||||
|
|
|
@ -192,7 +192,7 @@ def upload_submission(request):
|
|||
break
|
||||
|
||||
create_submission_event(request, submission, desc="Uploaded submission")
|
||||
docevent_from_submission(request, submission, desc="Uploaded new revision")
|
||||
# Don't add an "Uploaded new revision doevent yet, in case of cancellation
|
||||
|
||||
return redirect("ietf.submit.views.submission_status", submission_id=submission.pk, access_token=submission.access_token())
|
||||
except IOError as e:
|
||||
|
|
Loading…
Reference in a new issue