Skip to content

AutoSyncRecord inconsistent after file change #14952

Closed
@alehaa

Description

@alehaa

Deployment Type

Self-hosted

NetBox Version

v3.7.1

Python Version

3.11

Steps to Reproduce

  1. Create data source TestData:

    Field Value
    Name TestData
    Type git
    URL https://github.com/netbox-community/netbox-plugin-tutorial.git
    enabled yes
  2. Sync data source TestData.

  3. 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
  4. Edit export template TestExport.

  5. Select Data file tutorial/step01-initial-setup.md and save. (will fail).

  6. Go back to edit form for export template TestExport.

  7. 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.

Metadata

Metadata

Assignees

Labels

severity: mediumResults in substantial degraded or broken functionality for specfic workflowsstatus: acceptedThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the application

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions