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 GitHub
parent ab4011eae6
commit 736f641fa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -301,7 +301,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)