I have a context processor where I'm trying to override get_and_delete_messages
from forum.user_messages import get_and_delete_messages
def user_messages (request):
"""
Returns session messages for the current session.
"""
messages = request.user.get_and_delete_messages()
return { 'user_messages': messages }
It's not picking up a user message that I can see in the debugging session:
ipdb> request.session['messages']
["only site Admins can use that feature."]
The app seems to be calling the get_and_delete_messages from the User model @ django.contrib.auth.models:
Instead of the method I imported.
How do I get the correct model called?