Open quevon24 opened 6 years ago
I suggest to increase the max_length of the verb, or maybe implement a extra validation to trim the text
I think we should do both, increase the max_length and have a validation check during sending notifications instead of trimming it.
About the missing extra,
This is probably happening because another template is used to render the notification when using ajax.
See utils.py#12 to know the precedence. By default, the render function will look for <notification_type>_box.html
template and then fallback to default. Make sure you have overridden the template.
Feel free to send a pull request for this issue.
I think we should do both, increase the max_length and have a validation check during sending notifications instead of trimming it.
About the missing extra,
This is probably happening because another template is used to render the notification when using ajax.
See utils.py#12 to know the precedence. By default, the render function will look for
_box.html template and then fallback to default. Make sure you have overridden the template. Feel free to send a pull request for this issue.
Thanks for your answer, the notifications in my dropdown displays fine with my custom template(I named it mention_box.html) , so I think that is overridden, the problem is that remove the extras of the notifications after an ajax call to get new notifications (keeps my template and my styles but removing the extras)
Hmm, that shouldn't be happening. I'll try to reproduce this issue and let you know about it.
If you try to set a verb longer than 50 characters drops the error: django.db.utils.DataError: (1406, "Data too long for column 'verb' at row 1")
I suggest to increase the max_length of the verb, or maybe implement a extra validation to trim the text
Also I noticed if the notification box text, if you pass an extra and render it in your box template and then the notification it's added with ajax, it displays fine, but on next ajax call, erases the extra of addef notification in the template.
e.g. I send a notification:
notify.send(sender, recipient=recipient, actor=sender, actor_url='http://google.com.mx', verb='commented in here:', nf_type='comment', extra={'order':'ORDER1234'})
and it's rendered with this:
And displays like this:
ORDER1234 is the extra, extra={'order':'ORDER1234'}
But when comes the next ajax call to update the list(new or no new notification), now the notificacion it's displayed without the extra, erase the extra of the already added notification, like this: