For other buttons - "Save" and "Save and continue editing", this already
works exactly in this manner.
--
Ticket URL: <https://code.djangoproject.com/ticket/29376>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/9913 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:1>
* needs_tests: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:2>
Comment (by Carlton Gibson):
The options for Save and Save and continue were originally added to ensure
correct behaviour when hitting Save New and getting a validation error.
See
[https://github.com/django/django/commit/0894643e40327e48397573b7844585618200442b
0894643e4]. They weren't really for direct usage...
... however, maybe it's reasonable. Tentatively Accept to see how the
patch turns out, and what others think.
This isn't really documented (like much around extending the admin). Not
sure where it would go if we were to add something.
--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:3>
* needs_better_patch: 0 => 1
* stage: Unreviewed => Accepted
--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:4>
* type: Uncategorized => Cleanup/optimization
--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:5>
Comment (by Tim Graham):
A [https://stackoverflow.com/questions/13101281/in-django-admin-how-can-i
-hide-save-and-continue-and-save-and-add-another-butto/13104313
Stackoverflow question] suggests several alternatives including overriding
the template tag or adding some CSS.
I guess I'm okay with the patch (even if undocumented) but it needs a
test.
--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:6>
Comment (by gustavoefeiche):
Replying to [comment:6 Tim Graham]:
> A [https://stackoverflow.com/questions/13101281/in-django-admin-how-
can-i-hide-save-and-continue-and-save-and-add-another-butto/13104313
Stackoverflow question] suggests several alternatives including overriding
the template tag or adding some CSS.
>
> I guess I'm okay with the patch (even if undocumented) but it needs a
test.
The test is the only thing missing? I would like to work on it
--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:7>
Comment (by Mushtaq Ali):
Hey Tim, Is this still available to work, if yes - I would like to add
unit tests to it ?
--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:8>
* owner: nobody => Hasan Ramezani
* needs_better_patch: 1 => 0
* status: new => assigned
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:9>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"b9db423d3c525697ad59b14c0dcaaccf2770d062" b9db423d]:
{{{
#!CommitTicketReference repository=""
revision="b9db423d3c525697ad59b14c0dcaaccf2770d062"
Fixed #29376 -- Allowed hiding "Save and Add Another" button in admin.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29376#comment:10>