Skip to content

Conversation

@magicalyak
Copy link

Fixes: #355

PR #350 added None checks for self.original and self.current in _update_conflicts() but missed checking self.modified. This causes an AttributeError when creating objects with custom fields.

This adds:

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.
@magicalyak magicalyak requested a review from jnovinger November 7, 2025 13:39
@magicalyak magicalyak closed this Nov 7, 2025
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.

Custom field on circuit terminations causes AttributeError in branches

2 participants