Repository navigation
Conversation
Typed tabs snapshot field names at ready(). After a field is deleted or renamed, the badge's .filter() raised FieldError on every detail page of the referenced model (e.g. all Device pages). Catch it in the badge (hide the tab) and in the tab view (empty table).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Typed tabs save field names (
field_infos) atready(). When a Custom Object Type field is deleted or renamed after startup, those names no longer exist on the live dynamic model. The badge renders on every host detail page, so the stale names took down all of them:Evidence
FieldError: Cannot resolve keyword 'device' into field. Choices are: bookmarks, contacts, created, id, ...at
views/typed.py:239in_badge. Hit in the netbox-authorized-keys test suite (fresh DB, no custom object fields).After: new test
test_returns_none_when_field_no_longer_exists:filter()raisesFieldError→ badge returnsNone.pytest tests/37 passed, ruff clean.Merge Danger
Door: two-way
No models or migrations. Rollback = pin 3.0.0.
Blast Radius: tabs
Affected types keep a hidden tab and an empty table until NetBox restarts, which re-reads the fields. A warning is logged each time.