diff --git a/netbox/core/signals.py b/netbox/core/signals.py index dc9fc6cfa..a39a87c6a 100644 --- a/netbox/core/signals.py +++ b/netbox/core/signals.py @@ -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) diff --git a/netbox/netbox/models/features.py b/netbox/netbox/models/features.py index a43297979..6d82e2a2b 100644 --- a/netbox/netbox/models/features.py +++ b/netbox/netbox/models/features.py @@ -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()