Opened 18 years ago
Closed 17 years ago
#3356 closed (wontfix)
Ability to turn off new message in the Message framework when using create/edit/delete generic view
Reported by: | anonymous | Owned by: | nobody |
---|---|---|---|
Component: | Generic views | Version: | dev |
Severity: | Keywords: | generic views, message | |
Cc: | Triage Stage: | Design decision needed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
It would be great if Django provided a parameter to disable creating
a new message when using create/update/delete generic view.
It would be enabled by default.
Something like:
def delete_object(request, model, post_delete_redirect ...., create_info_message=True)
...
if request.user.is_authenticated() and create_info_message:
request.user.message_set.create(message=gettext("The %(verbose_name)s was deleted.") % {"verbose_name": model._meta.verbose_name})
return HttpResponseRedirect(post_delete_redirect)
Change History (3)
comment:1 by , 18 years ago
Triage Stage: | Unreviewed → Design decision needed |
---|
comment:2 by , 17 years ago
comment:3 by , 17 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
This minor change isn't worth the added argument to the generic views. You can accomplish the same thing with a wrapper around the generic view that clears messages after the view runs.
Since any
RequestContext
will, by default, clear the messages anyway, what's the use case for this?