Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't save message to the other user #18

Open
softzer0 opened this issue May 23, 2016 · 1 comment
Open

Can't save message to the other user #18

softzer0 opened this issue May 23, 2016 · 1 comment

Comments

@softzer0
Copy link

softzer0 commented May 23, 2016

I'm using similar command like from your example, but it doesn't work:

messages.add_message(request, constants_messages.INFO_PERSISTENT, "Hola abc desde %s" %request.user, user=sally)

It produces this error: TypeError: add() got an unexpected keyword argument 'user'

It seems like there's no such parameter as user in Django messages framework. Also the functions within this app like persistant_info don't help since they're just wrapper ones and therefore behave the same.

So, can this be fixed? Thanks in advance!

@JanMalte
Copy link
Contributor

@softzer0 did you set MESSAGE_STORAGE in ypur settings to 'messages_extends.storages.FallbackStorage', according to the install instructions in the README.md?

# project/settings.py
MESSAGE_STORAGE = 'messages_extends.storages.FallbackStorage'

Only the PersistentStorage can handle the user keyword argument:

user = kwargs.get("user") or self.get_user()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants