mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 09:16:10 -06:00
Cleanup
This commit is contained in:
parent
80904979a2
commit
9885184776
@ -17,5 +17,5 @@ def auto_sync(instance, **kwargs):
|
||||
"""
|
||||
from .models import AutoSyncRecord
|
||||
|
||||
for autosync in AutoSyncRecord.objects.filter(datafile__source=instance):
|
||||
for autosync in AutoSyncRecord.objects.filter(datafile__source=instance).prefetch_related('object'):
|
||||
autosync.object.sync(save=True)
|
||||
|
@ -453,6 +453,8 @@ class SyncedDataMixin(models.Model):
|
||||
"""
|
||||
Synchronize the object from it's assigned DataFile (if any). This wraps sync_data() and updates
|
||||
the synced_data timestamp.
|
||||
|
||||
:param save: If true, save() will be called after data has been synchronized
|
||||
"""
|
||||
self.sync_data()
|
||||
self.data_synced = timezone.now()
|
||||
|
Loading…
Reference in New Issue
Block a user