Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#15757 closed Bug (fixed)

get_and_delete_messages, removed in [15975], is still alive

Reported by: Alexey Boriskin Owned by: nobody
Component: contrib.auth Version: master
Severity: Release blocker Keywords:
Cc: Dmitry Dzhus Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Method get_and_delete_messages(), removed in [15975], is still alive in django.contrib.messages.api (line 44) and AnonymousUser.
This results in stack staces like:

File "/Users/voidus/Documents/workspace/django-trunk/django/template/response.py", line 155, in resolve_context
    return RequestContext(self._request, context, current_app=self._current_app)

  File "/Users/voidus/Documents/workspace/django-trunk/django/template/context.py", line 177, in __init__
    self.update(processor(request))

  File "/Users/voidus/Documents/workspace/django-trunk/django/contrib/auth/context_processors.py", line 58, in auth
    'messages': messages.get_messages(request),

  File "/Users/voidus/Documents/workspace/django-trunk/django/contrib/messages/api.py", line 44, in get_messages
    return lazy(memoize(get_user().get_and_delete_messages, {}, 0), list)()

AttributeError: 'User' object has no attribute 'get_and_delete_messages'

Attachments (1)

15757.contrib-messages-cleanup.diff (6.1 KB) - added by Julien Phalip 6 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 6 years ago by Russell Keith-Magee

Resolution: invalid
Status: newclosed

You've got something going on with your checkout -- possibly stale .pyc files, or a second checkout in your PYTHONPATH. The usage of get_and_delete_messages in contrib.messages.api line 44 has been removed.

comment:2 Changed 6 years ago by Alexey Boriskin

Resolution: invalid
Status: closedreopened

I see the get_and_delete_messages() call at the link you gave...

comment:3 Changed 6 years ago by Russell Keith-Magee

milestone: 1.4
Severity: NormalRelease blocker
Triage Stage: UnreviewedAccepted

Ok - I need to remember to leave off triaging until I've had my morning coffee.

Apologies for the ambient stupidity on my part.

Changed 6 years ago by Julien Phalip

comment:4 Changed 6 years ago by Julien Phalip

The attached patch cleans things up and also updates the doc to indicate the admin's dependency on contrib.messages and its middleware and context_processor.

comment:5 Changed 6 years ago by Julien Phalip

Has patch: set

comment:6 in reply to:  4 Changed 6 years ago by Dmitry Dzhus

Cc: Dmitry Dzhus added

Replying to julien:

The attached patch cleans things up and also updates the doc to indicate the admin's dependency on contrib.messages and its middleware and context_processor.

Works for me on fresh trunk.

comment:7 Changed 6 years ago by Luke Plant

Triage Stage: AcceptedReady for checkin

Thanks Julien.

comment:8 Changed 6 years ago by Luke Plant

Resolution: fixed
Status: reopenedclosed

In [16022]:

Fixed #15757 - removed remaining instances of get_and_delete_messages

Thanks to void for the report, and julien for the bulk of the patch.

comment:9 Changed 5 years ago by Jacob

milestone: 1.4

Milestone 1.4 deleted

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