Code

Opened 7 years ago

Closed 6 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: UI/UX:

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)

Attachments (0)

Change History (3)

comment:1 Changed 7 years ago by Simon G. <dev@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

comment:2 Changed 7 years ago by ubernostrum

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

comment:3 Changed 6 years ago by jacob

  • Resolution set to wontfix
  • Status changed from new to 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.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.