"save as new" redirects to list view instead of newly-created item
|Reported by:||candlerb||Owned by:||nobody|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||yes|
I have a model with save_as = True
After browsing to the model, changing some parameters and clicking "Save As", the browser redirects to the list of all objects instead of the newly-saved model instance.
There is code in response_change which looks like it is supposed to handle this case. However, after putting in some sys.stderr.write's, I see that the request is actually ending up in response_add instead :-(
The attached one-line patch to django/contrib/admin/options.py fixes it for me. However I'm not sure if that's right for all circumstances, nor whether the code in response_change which tests for "_saveasnew" is always unused and should also be removed.
Change History (7)
Changed 4 years ago by candlerb
comment:1 Changed 4 years ago by ramiro
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
- Triage Stage changed from Unreviewed to Design decision needed
- Type changed from Bug to Uncategorized