Opened 13 years ago

Closed 13 years ago

Last modified 13 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: dev
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: no UI/UX: no

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 13 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 by Russell Keith-Magee, 13 years ago

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 by Alexey Boriskin, 13 years ago

Resolution: invalid
Status: closedreopened

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

comment:3 by Russell Keith-Magee, 13 years ago

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.

by Julien Phalip, 13 years ago

comment:4 by Julien Phalip, 13 years ago

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 by Julien Phalip, 13 years ago

Has patch: set

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

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 by Luke Plant, 13 years ago

Triage Stage: AcceptedReady for checkin

Thanks Julien.

comment:8 by Luke Plant, 13 years ago

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 by Jacob, 13 years ago

milestone: 1.4

Milestone 1.4 deleted

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