1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

9077 audit alters_data=True

This commit is contained in:
Arthur
2023-05-31 13:47:22 -07:00
committed by Jeremy Stretch
parent 4f76dcd2ea
commit b4a3156046
7 changed files with 21 additions and 0 deletions

View File

@@ -71,6 +71,7 @@ class ChangeLoggingMixin(models.Model):
`_prechange_snapshot` on the instance.
"""
self._prechange_snapshot = self.serialize_object()
snapshot.alters_data = True
def to_objectchange(self, action):
"""
@@ -244,6 +245,7 @@ class CustomFieldsMixin(models.Model):
"""
for cf in self.custom_fields:
self.custom_field_data[cf.name] = cf.default
populate_custom_field_defaults.alters_data = True
def clean(self):
super().clean()
@@ -419,6 +421,7 @@ class SyncedDataMixin(models.Model):
self.data_synced = None
super().clean()
clean.alters_data = True
def save(self, *args, **kwargs):
from core.models import AutoSyncRecord
@@ -466,6 +469,7 @@ class SyncedDataMixin(models.Model):
self.data_synced = timezone.now()
if save:
self.save()
sync.alters_data = True
def sync_data(self):
"""