Description
Deployment Type
Self-hosted
NetBox Version
v3.7.1
Python Version
3.11
Steps to Reproduce
-
Create data source
TestData
:Field Value Name TestData Type git URL https://github.com/netbox-community/netbox-plugin-tutorial.git enabled yes
-
Sync data source
TestData
. -
Create export template
TestExport
:Field Value Name TestExport Content Types Circuits > Circuit
(but any will do)Data Source TestData Data File README.md Auto Sync Enabled yes
-
Edit export template
TestExport
. -
Select Data file
tutorial/step01-initial-setup.md
and save. (will fail). -
Go back to edit form for export template
TestExport
. -
Set Data source, Data file and Auto Sync enabled to null and save.
Expected Behavior
Step 5: Edit succeeds.
Step 7: AutoSyncRecord
is removed from database.
Observed Behavior
Step 5: An IntegrityError
error is raised, as SyncedDataMixin
's save()
method won't change existing AutoSyncRecord
objects.
Step 7: Edit succeeds, but the related AutoSyncRecord
stays in the database. This is due SyncedDataMixin
's save()
method will remove related AutoSyncRecord
objects, but the QuerySet
filter uses fields of the object previously set to None
in the edit form.