Opened 12 years ago

Closed 11 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: master
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


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 Changed 12 years ago by Simon G. <dev@…>

Triage Stage: UnreviewedDesign decision needed

comment:2 Changed 11 years ago by James Bennett

Since any RequestContext will, by default, clear the messages anyway, what's the use case for this?

comment:3 Changed 11 years ago by Jacob

Resolution: wontfix
Status: newclosed

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.

Note: See TracTickets for help on using tickets.
Back to Top