Skip to content

Commit 437a622

Browse files
committed
Set a temporary state 'confirmed' when handling submission confirmations in order to avoid running the confirmation code multiple times on multiple form submits.
- Legacy-Id: 14191
1 parent 1c3a613 commit 437a622

2 files changed

Lines changed: 28 additions & 17 deletions

File tree

ietf/name/fixtures/names.json

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7759,22 +7759,22 @@
77597759
{
77607760
"fields": {
77617761
"desc": "",
7762-
"name": "Document Source Repository",
7762+
"name": "Document issue tracker",
77637763
"order": 0,
77647764
"used": true
77657765
},
77667766
"model": "name.docurltagname",
7767-
"pk": "repository"
7767+
"pk": "issues"
77687768
},
77697769
{
77707770
"fields": {
77717771
"desc": "",
7772-
"name": "Document issue tracker",
7772+
"name": "Document source repository",
77737773
"order": 0,
77747774
"used": true
77757775
},
77767776
"model": "name.docurltagname",
7777-
"pk": "issues"
7777+
"pk": "repository"
77787778
},
77797779
{
77807780
"fields": {
@@ -7816,21 +7816,12 @@
78167816
"model": "name.docurltagname",
78177817
"pk": "yang-module-metadata"
78187818
},
7819-
{
7820-
"fields": {
7821-
"desc": "",
7822-
"name": "Yang module tree view",
7823-
"order": 0,
7824-
"used": true
7825-
},
7826-
"model": "name.docurltagname",
7827-
"pk": "yang-module-tree"
7828-
},
78297819
{
78307820
"fields": {
78317821
"desc": "",
78327822
"name": "Awaiting Approval from Previous Version Authors",
78337823
"next_states": [
7824+
"confirmed",
78347825
"cancel",
78357826
"posted"
78367827
],
@@ -7845,6 +7836,7 @@
78457836
"desc": "",
78467837
"name": "Awaiting Submitter Authentication",
78477838
"next_states": [
7839+
"confirmed",
78487840
"cancel",
78497841
"posted"
78507842
],
@@ -7865,6 +7857,20 @@
78657857
"model": "name.draftsubmissionstatename",
78667858
"pk": "cancel"
78677859
},
7860+
{
7861+
"fields": {
7862+
"desc": "",
7863+
"name": "Confirmed",
7864+
"next_states": [
7865+
"cancel",
7866+
"posted"
7867+
],
7868+
"order": 0,
7869+
"used": true
7870+
},
7871+
"model": "name.draftsubmissionstatename",
7872+
"pk": "confirmed"
7873+
},
78687874
{
78697875
"fields": {
78707876
"desc": "",
@@ -9982,7 +9988,7 @@
99829988
"fields": {
99839989
"command": "xym",
99849990
"switch": "--version",
9985-
"time": "2017-09-26T22:17:08.858",
9991+
"time": "2017-09-29T00:07:40.668",
99869992
"used": true,
99879993
"version": "xym 0.4"
99889994
},
@@ -9993,7 +9999,7 @@
99939999
"fields": {
999410000
"command": "pyang",
999510001
"switch": "--version",
9996-
"time": "2017-09-26T22:17:11.006",
10002+
"time": "2017-09-29T00:07:41.703",
999710003
"used": true,
999810004
"version": "pyang 1.7.3"
999910005
},
@@ -10004,7 +10010,7 @@
1000410010
"fields": {
1000510011
"command": "yanglint",
1000610012
"switch": "--version",
10007-
"time": "2017-09-26T22:17:11.079",
10013+
"time": "2017-09-29T00:07:41.812",
1000810014
"used": true,
1000910015
"version": "yanglint 0.13.49"
1001010016
},

ietf/submit/views.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,11 @@ def confirm_submission(request, submission_id, auth_token):
444444
if not key_matched: key_matched = auth_token == submission.auth_key # backwards-compat
445445

446446
if request.method == 'POST' and submission.state_id in ("auth", "aut-appr") and key_matched:
447+
# Set a temporary state 'confirmed' to avoid entering this code
448+
# multiple times to confirm.
449+
submission.state = DraftSubmissionStateName.objects.get(slug="confirmed")
450+
submission.save()
451+
447452
action = request.POST.get('action')
448453
if action == 'confirm':
449454
submitter_parsed = submission.submitter_parsed()

0 commit comments

Comments
 (0)