#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)
Change History (10)
comment:1 by , 15 years ago
| Resolution: | → invalid | 
|---|---|
| Status: | new → closed | 
comment:2 by , 15 years ago
| Resolution: | invalid | 
|---|---|
| Status: | closed → reopened | 
I see the get_and_delete_messages() call at the link you gave... 
comment:3 by , 15 years ago
| milestone: | → 1.4 | 
|---|---|
| Severity: | Normal → Release blocker | 
| Triage Stage: | Unreviewed → Accepted | 
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 , 15 years ago
| Attachment: | 15757.contrib-messages-cleanup.diff added | 
|---|
follow-up: 6 comment:4 by , 15 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 , 15 years ago
| Has patch: | set | 
|---|
comment:6 by , 15 years ago
| Cc: | added | 
|---|
Replying to julien:
The attached patch cleans things up and also updates the doc to indicate the admin's dependency on
contrib.messagesand its middleware and context_processor.
Works for me on fresh trunk.
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.