Skip to content

Conversation

@jeremystretch
Copy link
Contributor

Fixes: #349

_update_conflicts() should no-op if either the original or current data is missing for comparison.

@jeremystretch jeremystretch requested a review from a team October 29, 2025 16:28
@arthanson arthanson merged commit f0f60c8 into main Oct 29, 2025
12 checks passed
magicalyak added a commit that referenced this pull request Nov 7, 2025
This fixes an AttributeError that occurs when creating objects with
custom fields in a branch. PR #350 partially addressed this by checking
for None in self.original and self.current, but missed checking
self.modified.

Changes:
- Add None check for self.modified in addition to original and current
- Add safety check 'k in self.modified' before accessing modified[k]
- Explicitly set self.conflicts = None before returning for clarity

This prevents AttributeError when:
- Creating circuit terminations with custom fields
- Creating devices with module bays and custom fields
- Any object creation where self.modified is None

Added comprehensive test coverage in test_changediff.py to verify
the fix handles all None value scenarios correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError exception when removing a device from a virtual chassis with a branch active

3 participants