Opened 11 years ago
Closed 11 years ago
#21926 closed Cleanup/optimization (duplicate)
SuccessMessageMixin not working for DeleteView
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Generic views | Version: | 1.6 |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Neither setting
success_message = "Something!"
or
def get_success_message(self, cleaned_data): return "Something"*10
works. I can confirm that the SuccessMessageMixin works fine for UpdateView and CreateView. Here's a quit sample project:
Change History (3)
comment:1 by , 11 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Cleanup/optimization |
comment:2 by , 11 years ago
I guessed as much. FWIW my (temporary) solution was to just set a success message in def delete(self, request, *args, **kwargs)
Thanks for the quick reply/update. At least now I know I'm not missing something :)
comment:3 by , 11 years ago
Resolution: | → duplicate |
---|---|
Status: | new → closed |
Closing it as it is a duplicate of #21936
Note:
See TracTickets
for help on using tickets.
SuccessMessageMixin
hooks toform_valid
which is not present onDeleteView
to push its message to the user.I remember seeing another ticket or discussion about the unification of
DeleteView
withCreateView
andUpdateView
. If someone else manage to find such a ticket I think it should supersede this one since theSuccessMessageMixin
issue described here is really just a side effect of the deviation ofDeleteView
.