django-messages-extends icon indicating copy to clipboard operation
django-messages-extends copied to clipboard

Can't save message to the other user

Open softzer0 opened this issue 9 years ago • 1 comments

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!

softzer0 avatar May 23 '16 11:05 softzer0

@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: https://github.com/AliLozano/django-messages-extends/blob/d231b6535e95c31fe26ae33148615961ec07454b/messages_extends/storages.py#L166

JanMalte avatar Jul 16 '21 11:07 JanMalte