Opened 7 years ago

Closed 7 years ago

#7137 closed (invalid)

get_and_delete_messages is called in auth context processor for every request

Reported by: tangerine Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords: context processor
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

user.get_and_delete_messages() is called irrespective of whether the request is for a page within the admin interface or not. Although it's typically only one extraneous query, it is extra overhead which is unnecessary for the vast majority of requests. Maybe it could be moved out in to a admin context processor which simply adds messages to the context?

Change History (1)

comment:1 Changed 7 years ago by ubernostrum

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to invalid
  • Status changed from new to closed

The messaging system is not an admin-specific feature; it is a general-purpose part of Django's authentication framework and is intended for use in any code which needs the ability to display such messages to a user (see, for example, its use in the views in django.views.generic.create_update).

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