`nullable_fields` only marks declared form fields as clearable.
Several bulk edit forms referenced missing, stale, duplicate, or
non-model fields. This left intended fields unavailable, rendered
ineffective Set Null controls, and could trigger a server error for
Contact bulk edits.
Declare the intended fields, correct the PowerFeed and DataSource
entries, and remove invalid Contact group fields. Align owner and
comments nullification on forms that do not inherit the common
bulk-edit fields, and prevent DataSource comments from rendering twice.
Add regression coverage to keep nullable declarations aligned with
their form and model fields.
Fixes#22990
CableType.a_terminations and b_terminations were declared as bare
annotations, so strawberry-django resolved them by reading the model
properties with no prefetch hint. That left two nested N+1s (one query
per Cable for terminations, one per CableTermination for the termination
GFK) plus the termination's own device FK chain, for roughly six queries
per termination.
Resolve both fields via resolvers carrying a Prefetch of the
terminations for that cable end, with the termination GFK prefetched
through the existing build_gfk_prefetch() helper so the nested joins are
derived from the client's selection set rather than hard-coded.
Each end is prefetched under its own to_attr: two prefetches of the same
relation cannot be merged by the query optimizer, so a shared lookup
would break any query selecting both ends.
Replace hardcoded width check with Bootstrap's lg breakpoint (992px)
using matchMedia API. Adds constant with comment linking to navbar
configuration for maintainability.
Remove Bootstrap Collapse instances and section link handling logic that
is no longer needed. Simplifies sidebar navigation by removing manual
collapse management and related event handlers.
Fixes#22931
The REST API's write paths are transactional, but the in-memory events queue
is not: change logging receivers queue events eagerly (for deletions in
pre_delete, before the row is removed), and event_tracking() flushes that queue
only after the response has been rendered. Where a rolled-back write is caught
and converted into a normal response — the ProtectedError/RestrictedError and
AbortRequest handlers in NetBoxModelViewSet.dispatch(), and the
ObjectDoesNotExist to PermissionDenied conversions in the perform_*() methods —
the flush therefore dispatched events for objects that were never created,
updated, or deleted.
Backport discard_events_on_rollback() from the feature branch and enter it
inside the transaction guarding each API write: perform_create(),
perform_update(), and perform_destroy(); the SequentialBulkCreatesMixin,
BulkUpdateModelMixin, and BulkDestroyModelMixin bulk actions; and
AvailableObjectsView.post(). The context manager sends clear_events on the way
out whenever the wrapped transaction is rolled back, whether by an exception
escaping the block or by an explicit set_rollback(), which also covers the
exceptions that reach dispatch(). This mirrors what the UI views now do (#22934).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Removes clone_fields declarations from ContactAssignment,
ImageAttachment, and FHRPGroupAssignment models that don't inherit
CloningMixin.
Adds test coverage to prevent clone_fields on models without cloning
support.
Fixes#22987
Add 4X interface choices for all supported InfiniBand generations and
include the lane width in each display label. Correct the existing XDR
1X rate from 250 Gbps to 200 Gbps.
Skip descendant and component denormalization updates when a Location,
Rack, or Device is saved without changing its scope assignments. Handle
partial saves safely to avoid propagating stale in-memory values.
Introduces 100GBASE-X-SFP112 interface type to support SFP112 form
factor transceiver modules. Adds new choice constant and display label
in alphabetical order within 100GE interface types section.
Fixes#22998
Replace redundant conditional blocks with single if-else statement and
move resize listener outside viewport check. Changes width threshold
from `>` to `>=` for consistency with standard breakpoint behavior.
Fixes#22930
Changes Script logger initialization to use `full_name` property instead
of reconstructing the namespace from `__module__` and
`__class__.__name__`.
Ensures dynamically loaded Scripts log to the correct public namespace.
Fixes#22953
Replace RelatedObjectAttr with NestedObjectAttr for Tenant Groups,
Wireless LAN Groups, and Device Type default platforms. Limit Platform
hierarchies to three levels for consistency with existing Platform
fields.
Fixes#22954
initSideNav() matched every .navbar element, and
templates/base/layout.html puts that class on both the sidebar aside and
the top header, so a second SideNav was constructed for the header.
Scope the selector to .navbar-vertical, which is what the pre-Tabler
selector .sidenav did.
Widen the sidebar element type from HTMLDivElement to HTMLElement, since
the element the selector matches is an aside.
Fixes#22929
Display ancestor hierarchy in breadcrumbs for DeviceRole, Platform, and
PowerPanel detail views. Shows full parent chain with filtering links
to improve navigation through nested object relationships.
Fixes#22957
BulkCreateView, BulkDeleteView, and ObjectDeleteView each catch an exception,
roll back the transaction, and return a normal response — but without clearing
the in-memory events queue. The queue is flushed after the view returns, so
webhooks and event rules fired for creations and deletions that were never
committed.
Send the clear_events signal from each of the affected handlers, matching the
idiom already used by the sibling handlers in these views.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
handle_location_site_change() repaired the cached scope fields of Location-
scoped Prefixes, Clusters and WirelessLANs, but not CircuitTerminations,
which cache the same ancestry under their own termination_type/termination_id
generic FK rather than CachedScopeMixin.scope. That made them invisible both
to the repair loop and to sync_cached_scope_fields().
Two cases were left wrong. A termination at a descendant Location kept its
_site, _region and _site_group entirely, since descendants are moved by a
queryset update() which fires no post_save. A termination at the moved
Location itself had _site refreshed by the denormalized-field registry, but
not _region or _site_group: those are mapped off the separate _site
registration, which requires a Site save.
Repair both cases by selecting through the generic termination fields over
the Location and its descendants alike. These columns back the site, region
and site group filters for Circuit and CircuitTermination, so a stale value
drops the circuit out of filtered lists and leaves it showing under its
former site.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Updates ModuleType bulk import test to use valid test data. Replaces
reference to non-existent 'Fan' profile with test fixture profile.
Changes assertion to use assertEqual for consistency with test patterns.
Closes#22925
Replace the obsolete Django admin `vLargeTextField` class with Tabler's
`font-monospace` utility for the four banner configuration parameters.
Define the widget styling in the parameter definitions, where the metaclass
constructs the form fields, and remove the ineffective `Meta.widgets`
overrides. Add regression coverage for all six code-oriented configuration
fields, including the two JSON fields that already use a monospace font.
Update the add-config-param skill to recommend `font-monospace` so future
textarea-backed parameters do not reintroduce the obsolete admin class.
Adds comprehensive test cases for NestedObjectAttr including ancestor
traversal, max_depth limiting, null value handling, and linkify/colored
options. Uses Region model with MPTT hierarchy for testing nested
object rendering.
Closes#22956
Pin `twine` and `packaging` versions in build job to match bundled
versions in `gh-action-pypi-publish` v1.14.2.
Enforce Core Metadata 2.4 in wheel and sdist targets with verification
in validation scripts.
Fixes#22903
During partial bulk updates, fields omitted from the CSV are removed
from the import form before validation. Model validation can still
return an error for one of these fields, causing Django to raise a
ValueError instead of displaying the validation error.
Remap errors for absent fields to prefixed non-field errors on
NetBoxModelImportForm while preserving their codes, parameters, lazy
pluralization, and literal percent values. Genuine non-field errors
remain unchanged.
Add form-level and view-level regression coverage for mixed and
parameterized errors and for the reported interface bulk-update
workflow, including verification that invalid updates leave the object
unchanged.