Assign copy of kwargs instead of direct reference

Make a shallow copy of kwargs and assign it to the data attribute. 
It allows overriding the save method of the model which can modify data if needed.
This commit is contained in:
Igor Malinovskiy 2022-05-18 15:44:37 +02:00 committed by Alvaro Mariano
parent ba81517243
commit efdd3ab086

View file

@ -320,7 +320,7 @@ def notify_handler(verb, **kwargs):
ContentType.objects.get_for_model(obj))
if kwargs and EXTRA_DATA:
newnotify.data = kwargs
newnotify.data = kwargs.copy()
newnotify.save()
new_notifications.append(newnotify)