mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-23 04:22:01 -06:00
Fixes #14952: Update existing AutoSyncRecord when changing the data file of an auto-synced object
This commit is contained in:
parent
2e74952ac6
commit
de5c5aeb2a
@ -489,10 +489,10 @@ class SyncedDataMixin(models.Model):
|
||||
# Create/delete AutoSyncRecord as needed
|
||||
content_type = ContentType.objects.get_for_model(self)
|
||||
if self.auto_sync_enabled:
|
||||
AutoSyncRecord.objects.get_or_create(
|
||||
datafile=self.data_file,
|
||||
AutoSyncRecord.objects.update_or_create(
|
||||
object_type=content_type,
|
||||
object_id=self.pk
|
||||
object_id=self.pk,
|
||||
defaults={'datafile': self.data_file}
|
||||
)
|
||||
else:
|
||||
AutoSyncRecord.objects.filter(
|
||||
|
Loading…
Reference in New Issue
Block a user