Skip to content

Simplify typed-tab internals (ponytail audit) - #22

Merged
Kani999 merged 1 commit into
masterfrom
chore/ponytail-audit
Sep 16, 2026
Merged

Kani999 merged 1 commit into
masterfrom
chore/ponytail-audit

Conversation

@Kani999

@Kani999 Kani999 commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Repo-wide over-engineering audit applied. No behaviour change.

  • typed.py: shared _host_q() for badge + view querysets; one error-render path; field_info unpacked directly (producers always emit 5-tuples); dropped get_verbose_name AttributeError guard, seen_field_keys de-dup set (querysets disjoint on is_polymorphic), __qualname__ assignment.
  • views/__init__.py: dropped ImportError/LookupError fallbacks that the ready() gate makes unreachable; dropped cosmetic dispatcher rename.
  • typed/tab.html: bulk-action buttons moved to typed/bulk_buttons.html include (was pasted twice); duplicate {% csrf_token %} removed.
  • pyproject.toml: package-data **/* already covers templates; MANIFEST.in removed.
  • tests: fixtures use the 5-tuple contract; obsolete 2-tuple test removed.

Verification

  • ruff, djlint, pytest tests/ (36 passed)
  • runserver HTTP smoke on NetBox 4.7 + netbox-custom-objects v0.7.0: login, Device 4274 (upstream combined + typed tabs, active tab, HTMX partial), CO page cotab2-parent/1 (all tabs 200, ours active), dispatcher 404 on unknown slug, bulk buttons / csrf / Add button still rendered.

No behaviour change. Applies the repo-wide over-engineering audit:

- typed.py: shared _host_q() replaces the duplicated Q-OR loop in the
  badge and the view; one error-render path instead of two; field_info
  tuples unpacked directly (producers always emit 5-tuples); drop the
  get_verbose_name AttributeError guard, the seen_field_keys de-dup set
  (querysets are disjoint on is_polymorphic) and the __qualname__ assignment.
- views/__init__.py: drop ImportError/LookupError fallbacks that ready()'s
  gate already makes unreachable; drop the cosmetic dispatcher rename.
- typed/tab.html: bulk-action buttons moved to typed/bulk_buttons.html
  include (was pasted twice); duplicate {% csrf_token %} removed.
- pyproject: package-data "**/*" already covers templates; MANIFEST.in removed.
- tests: field_info fixtures use the 5-tuple contract; obsolete 2-tuple test removed.
@Kani999
Kani999 merged commit 7ef1622 into master Sep 16, 2026
2 checks passed
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.

1 participant