mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-22 20:12:00 -06:00
Remove redundant prechange_data assignments
This commit is contained in:
parent
eb8e4f64fc
commit
e4f3b3447e
@ -36,9 +36,6 @@ def _handle_changed_object(request, sender, instance, **kwargs):
|
||||
# Record an ObjectChange if applicable
|
||||
if hasattr(instance, 'to_objectchange'):
|
||||
objectchange = instance.to_objectchange(action)
|
||||
# TODO: Move this to to_objectchange()
|
||||
if hasattr(instance, '_prechange_snapshot'):
|
||||
objectchange.prechange_data = instance._prechange_snapshot
|
||||
objectchange.user = request.user
|
||||
objectchange.request_id = request.id
|
||||
objectchange.save()
|
||||
@ -65,9 +62,6 @@ def _handle_deleted_object(request, sender, instance, **kwargs):
|
||||
# Record an ObjectChange if applicable
|
||||
if hasattr(instance, 'to_objectchange'):
|
||||
objectchange = instance.to_objectchange(ObjectChangeActionChoices.ACTION_DELETE)
|
||||
# TODO: Move this to to_objectchange()
|
||||
if hasattr(instance, '_prechange_snapshot'):
|
||||
objectchange.prechange_data = instance._prechange_snapshot
|
||||
objectchange.user = request.user
|
||||
objectchange.request_id = request.id
|
||||
objectchange.save()
|
||||
|
Loading…
Reference in New Issue
Block a user