Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#15757 closed Bug (fixed)

get_and_delete_messages, removed in [15975], is still alive

Reported by: void Owned by: nobody
Component: contrib.auth Version: master
Severity: Release blocker Keywords:
Cc: 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 4 years ago.

Download all attachments as: .zip

Change History (10)

comment:1 Changed 4 years ago by russellm

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

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 4 years ago by void

  • Resolution invalid deleted
  • Status changed from closed to reopened

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

comment:3 Changed 4 years ago by russellm

  • milestone set to 1.4
  • Severity changed from Normal to Release blocker
  • Triage Stage changed from Unreviewed to 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.

Changed 4 years ago by julien

comment:4 follow-up: Changed 4 years ago by 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.

comment:5 Changed 4 years ago by julien

  • Has patch set

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

  • Cc 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 4 years ago by lukeplant

  • Triage Stage changed from Accepted to Ready for checkin

Thanks Julien.

comment:8 Changed 4 years ago by lukeplant

  • Resolution set to fixed
  • Status changed from reopened to closed

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 4 years ago by jacob

  • milestone 1.4 deleted

Milestone 1.4 deleted

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