[Django] #28889: Prevent double submission on admin forms

20 views
Skip to first unread message

Django

unread,
Dec 5, 2017, 6:24:22 AM12/5/17
to django-...@googlegroups.com
#28889: Prevent double submission on admin forms
-------------------------------------------+------------------------
Reporter: Manuel Saelices | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
For fast clickers.

--
Ticket URL: <https://code.djangoproject.com/ticket/28889>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Dec 5, 2017, 6:24:53 AM12/5/17
to django-...@googlegroups.com
#28889: Prevent double submission on admin forms
---------------------------------+--------------------------------------

Reporter: Manuel Saelices | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.11
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+--------------------------------------

Old description:

> For fast clickers.

New description:

For fast clickers.

--

Comment (by Manuel Saelices):

Fixed on this Pull Request: https://github.com/django/django/pull/9425

--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:1>

Django

unread,
Dec 5, 2017, 8:29:19 AM12/5/17
to django-...@googlegroups.com
#28889: Prevent double submission on admin forms
---------------------------------+------------------------------------

Reporter: Manuel Saelices | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+------------------------------------
Changes (by Aymeric Augustin):

* stage: Unreviewed => Accepted


Comment:

I think this is an improvement and the implementation looks reasonable.

--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:2>

Django

unread,
Dec 5, 2017, 10:44:49 AM12/5/17
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
--------------------------------------+------------------------------------

Reporter: Manuel Saelices | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Tim Graham):

* has_patch: 0 => 1
* type: Bug => Cleanup/optimization
* needs_tests: 0 => 1


Comment:

I found an article titled [http://www.the-art-of-
web.com/javascript/doublesubmit/ JavaScript: Preventing Double Form
Submission] which might be worth reviewing. In particular, it points out
"Rather than simply disabling the button, we can also change the text so
that people don't get confused."

Did you consider trying to add some tests for the patch?

I share Nick's concern on the pull request that this may have a good
chance of causing some regression in unconsidered edge cases. I'm not sure
if it's considered a best practice these days. The article suggests that
some browsers (e.g. IE11) treat a double click as a single click. It
seems unfortunate if every project has to add something like this.

--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:3>

Django

unread,
Jan 21, 2018, 9:34:49 AM1/21/18
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Karan
Type: | Bedi
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Karan Bedi):

* owner: nobody => Karan Bedi
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:4>

Django

unread,
Jan 21, 2018, 12:02:57 PM1/21/18
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Karan
Type: | Bedi
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Karan Bedi):

I have created a PR. Please guide me how to proceeding further.
[https://github.com/django/django/pull/9608 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:5>

Django

unread,
Jan 22, 2018, 4:12:29 AM1/22/18
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Karan
Type: | Bedi
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson):

Hi Karan,

Thanks for the input. Your fix includes the changes Nick suggested from
the original PR. (Great.)

To get this merged we need to address Tim's concerns.

* Can we add some selenium tests, to exercise the behaviour?
* What's your assessment of the article Tim linked to? Do we need to do
this?

--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:6>

Django

unread,
Jan 25, 2018, 11:29:17 AM1/25/18
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Karan
Type: | Bedi
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Karan Bedi):

Hi Carlton,

- I am unable to reproduce the behavior, probably because till now, I am
serving on localhost.
- In the article, there are different methods of implementing the same.
One improvement can be changing the label of the submit button after a
click.
- From the point of usability, there is just a comment by someone, which
also doesn't seem concrete.

Please guide me on how to proceed further.

--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:7>

Django

unread,
Jun 8, 2021, 3:37:01 PM6/8/21
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
--------------------------------------+------------------------------------
Reporter: Manuel Saelices | Owner: (none)
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* owner: Karan Bedi => (none)
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:8>

Django

unread,
Dec 18, 2021, 12:24:20 PM12/18/21
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Marcelo Galigniana):

* owner: (none) => Marcelo Galigniana


* status: new => assigned

* has_patch: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:9>

Django

unread,
Dec 19, 2021, 10:12:05 PM12/19/21
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Marcelo Galigniana):

* has_patch: 0 => 1
* needs_tests: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:10>

Django

unread,
Dec 20, 2021, 9:13:36 AM12/20/21
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:11>

Django

unread,
Dec 23, 2021, 9:58:58 AM12/23/21
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Marcelo Galigniana):

For this issue there are currently 2 approaches:

- [https://github.com/django/django/pull/15217 Trigger an alert when
submitting twice]

- [https://github.com/django/django/pull/15229 Disable buttons while
submitting]

--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:12>

Django

unread,
Jan 21, 2022, 2:18:33 PM1/21/22
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Marcelo Galigniana):

Is there anything I can do to move this forward?

Should I create a conversation at the django-developers google group?

IMO the 2nd approach: "Disable buttons while submitting" it's simpler and
works well!

--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:13>

Django

unread,
Feb 23, 2022, 5:40:29 AM2/23/22
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_better_patch: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:14>

Django

unread,
Feb 23, 2022, 8:58:00 AM2/23/22
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 1.11
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson <carlton@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"fe7dbef5867c577995f0fc849d8dfdb8f2e6bbfa" fe7dbef]:
{{{
#!CommitTicketReference repository=""
revision="fe7dbef5867c577995f0fc849d8dfdb8f2e6bbfa"
Fixed #28889 -- Prevented double submission of admin forms.

Added a JavaScript confirm() to catch double-submissions, when the
change form has already been submitted.

Thanks to Adam Johnson, Claude Paroz, Keryn Knight, and Thibaud Colas
for review.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:15>

Django

unread,
Aug 5, 2022, 11:21:48 AM8/5/22
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"0756c61f2ada56e4ae625589099c0141a77737eb" 0756c61f]:
{{{
#!CommitTicketReference repository=""
revision="0756c61f2ada56e4ae625589099c0141a77737eb"
Fixed #33893 -- Reverted "Fixed #28889 -- Prevented double submission of
admin forms."

Regression in fe7dbef5867c577995f0fc849d8dfdb8f2e6bbfa.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:16>

Django

unread,
Aug 5, 2022, 11:22:16 AM8/5/22
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 1.11

Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"82e9e19ebe6bc920f1cfffc42d86648644fd4a78" 82e9e19]:
{{{
#!CommitTicketReference repository=""
revision="82e9e19ebe6bc920f1cfffc42d86648644fd4a78"
[4.1.x] Fixed #33893 -- Reverted "Fixed #28889 -- Prevented double
submission of admin forms."

Regression in fe7dbef5867c577995f0fc849d8dfdb8f2e6bbfa.

Backport of 0756c61f2ada56e4ae625589099c0141a77737eb from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:17>

Django

unread,
Aug 5, 2022, 11:23:54 AM8/5/22
to django-...@googlegroups.com
#28889: Use JavaScript to prevent double submission of admin forms
-------------------------------------+-------------------------------------
Reporter: Manuel Saelices | Owner: Marcelo
Type: | Galigniana
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 1.11
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* has_patch: 1 => 0

* resolution: fixed => wontfix
* stage: Ready for checkin => Unreviewed


Comment:

Patch was reverted, it's probably not worth complexity.

--
Ticket URL: <https://code.djangoproject.com/ticket/28889#comment:18>

Reply all
Reply to author
Forward
0 new messages