mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #3452: Queue deletion ObjectChanges until after response is sent
This commit is contained in:
@ -953,8 +953,10 @@ class ObjectChange(models.Model):
|
||||
def save(self, *args, **kwargs):
|
||||
|
||||
# Record the user's name and the object's representation as static strings
|
||||
self.user_name = self.user.username
|
||||
self.object_repr = str(self.changed_object)
|
||||
if not self.user_name:
|
||||
self.user_name = self.user.username
|
||||
if not self.object_repr:
|
||||
self.object_repr = str(self.changed_object)
|
||||
|
||||
return super().save(*args, **kwargs)
|
||||
|
||||
|
Reference in New Issue
Block a user