Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch merge failure on many-to-many assignments #16

Closed
jeremystretch opened this issue Jul 22, 2024 · 2 comments
Closed

Branch merge failure on many-to-many assignments #16

jeremystretch opened this issue Jul 22, 2024 · 2 comments
Assignees
Labels
type: bug A confirmed report of unexpected behavior in the application

Comments

@jeremystretch
Copy link
Contributor

jeremystretch commented Jul 22, 2024

Plugin Version

v0.2.0

NetBox Version

v4.1-dev

Python Version

3.10

Steps to Reproduce

  1. Create & activate a branch
  2. Edit an existing interface and assign one or more VLANs
  3. Attempt to merge the branch

Expected Behavior

The branch should be merged successfully.

Observed Behavior

The merge job fails with the following error:

TypeError('Direct assignment to the forward side of a many-to-many set is prohibited. Use tagged_vlans.set() instead.')

Private Preview Participant Links

Bloomberg: https://netdev-community.slack.com/archives/C07CP24P6AX/p1721395501733989

@jeremystretch jeremystretch added the type: bug A confirmed report of unexpected behavior in the application label Jul 22, 2024
@jeremystretch jeremystretch self-assigned this Jul 22, 2024
Copy link

linear bot commented Jul 22, 2024

BRA-7 Branch merge failure on many-to-many assignments

Plugin Version

v0.2.0

NetBox Version

v4.1-dev

Python Version

3.10

Steps to Reproduce

  1. Create & activate a branch
  2. Edit an existing interface and assign one or more VLANs
  3. Attempt to merge the branch

Expected Behavior

The branch should be merged successfully.

Observed Behavior

The merge job fails with the following error:

TypeError('Direct assignment to the forward side of a many-to-many set is prohibited. Use tagged_vlans.set() instead.')

@jeremystretch
Copy link
Contributor Author

AFAICT this only occurs when changing both an M2M field and some other type of field on the object; changing either alone works as expected. My guess at this point is that it has to do with calling save() on the object after modifying M2M relationships, but I'm not sure why. Still digging into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

1 participant