Commit Graph

15609 Commits

Author SHA1 Message Date
Jeremy Stretch f8b00e9aae Release v4.6.9 2026-08-25 11:02:20 -04:00
Martin Hauser 1077ff4a33 fix(forms): Correct nullable_fields in bulk edit forms
`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
2026-08-25 09:06:31 -04:00
Jeremy Stretch eab6b42659
Fixes #23000: Prefetch Cable Terminations in the GraphQL API (#23021)
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.
2026-08-25 09:27:14 +02:00
github-actions 194f3bbde2 Update source translation strings 2026-08-25 05:09:57 +00:00
bctiemann b7e02fe098
Merge pull request #23020 from netbox-community/23007-sidenav-javascript-uses-a-different-breakpoint-from-the
Closes #23007: Align sidebar initialization with the responsive layout breakpoint
2026-08-24 17:51:44 -04:00
Martin Hauser 105e58a433
refactor(ui): Use matchMedia for desktop breakpoint detection
Replace hardcoded width check with Bootstrap's lg breakpoint (992px)
using matchMedia API. Adds constant with comment linking to navbar
configuration for maintainability.
2026-08-24 22:12:54 +02:00
bctiemann b08799860f
Merge pull request #23017 from netbox-community/22978-event-leakage-on-rollback
Fixes #22978: Discard queued events when a REST API write is rolled back
2026-08-24 16:00:23 -04:00
piyush-003 a0c695f57d
Closes #22660: Add support for HPE Synergy's proprietary 300Gb QSFP-DD interface type 2026-08-24 15:58:42 -04:00
Martin Hauser 9d4440beba refactor(ui): Remove unused Bootstrap Collapse from sidebar navigation
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
2026-08-24 12:55:44 -04:00
Jeremy Stretch 79f940f362 Fixes #22978: Discard queued events when a REST API write is rolled back
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>
2026-08-24 12:41:32 -04:00
Martin Hauser 4107109472
fix(models): Remove inert clone_fields from non-CloningMixin models (#23003)
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
2026-08-24 08:46:05 -07:00
Jossel1n M0uette fd15a687f6
Closes #21387: Add InfiniBand 4X interface types (#23016)
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.
2026-08-24 17:45:34 +02:00
Jeremy Stretch 05e35e9264
Fixes #23013: Avoid denormalization refreshes for location assignment when not needed (#23014)
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.
2026-08-24 17:30:37 +02:00
github-actions 43fe81f9e8 Update source translation strings 2026-08-22 05:06:32 +00:00
bctiemann 23e2c881b1
Merge pull request #23004 from netbox-community/22998-add-100gbase-x-sfp112-interface-type
Closes #22998: Add SFP112 (100GE) interface type
2026-08-21 10:24:52 -04:00
github-actions 1c84d6d8f4 Update source translation strings 2026-08-21 05:21:48 +00:00
Martin Hauser 044a627c3a
feat(dcim): Add SFP112 interface type for 100GE connections
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
2026-08-20 22:22:40 +02:00
Jeremy Stretch e49e6afbbe
Fixes #22985: Exempt data file content from cache (#22986) 2026-08-20 21:14:53 +02:00
Martin Hauser b6cc7d811f fix(ui): Simplify sidebar initialization logic
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
2026-08-20 14:41:54 -04:00
bctiemann 58ac88bc51
Merge pull request #22974 from netbox-community/22934-fix-event-queue-leaks
Fixes #22934: Clear queued events when a UI view rolls back a write
2026-08-20 13:32:27 -04:00
bctiemann 24b700336e
Merge pull request #22969 from netbox-community/22925-make-moduletypetestcase-independent-of-migration-seeded-data
Closes #22925: Make ModuleTypeTestCase independent of migration-seeded data
2026-08-20 13:14:41 -04:00
bctiemann 86c7a896a1
Merge pull request #22958 from netbox-community/22956-add-dedicated-tests-for-nestedobjectattr
Closes #22956: Add test coverage for NestedObjectAttr
2026-08-20 13:13:39 -04:00
Martin Hauser fb86029507
fix(extras): Use full_name for Script logger namespace (#22964)
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
2026-08-19 13:06:53 -07:00
Martin Hauser 3f662dd222 fix(ui): Display nested group and platform hierarchies
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
2026-08-19 15:05:24 -04:00
Martin Hauser 604653935c fix(ui): Restrict sidebar initialization to the vertical navbar
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
2026-08-19 14:53:21 -04:00
Jeremy Stretch 6578541eee
Add optional suspected cause & suggested fix fields to bug report template (#22971) 2026-08-19 13:31:02 +02:00
github-actions 7fbd49369a Update source translation strings 2026-08-19 05:19:06 +00:00
Martin Hauser 5d9fa7be86 fix(ui): Add hierarchical breadcrumbs for nested objects
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
2026-08-18 16:41:47 -04:00
Jeremy Stretch c2d39b12d8
Fixes #22922: Honor the saving database connection in scope propagation signals (#22928) 2026-08-18 22:40:30 +02:00
Jeremy Stretch f72072128a Fixes #22934: Clear queued events when a UI view rolls back a write
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>
2026-08-18 15:59:44 -04:00
Jeremy Stretch 40a9df14a8 Fixes #22967: Repair CircuitTermination cached scope fields on Location move
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>
2026-08-18 14:40:20 -04:00
Jeremy Stretch a6f8848e3c
Fixes #22963: Honor the saving database connection in counter cache signals (#22965) 2026-08-18 11:19:13 -05:00
Martin Hauser 8e508d52f9
test(dcim): Fix ModuleType CSV import test data and assertions
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
2026-08-18 17:23:33 +02:00
Mohamed Hossam 560d595ac3
Closes #22716: Restrict image sources to HTTP(S) and relative URLs 2026-08-18 11:08:46 -04:00
Martin Hauser 59c42dfd20
Fixes #22944: Display nested role hierarchy in Virtual Machine info panel (#22955) 2026-08-18 09:52:51 -05:00
Jason Novinger d38ace89ce
Fixes #22889: Render Config Revision banner fields in monospace (#22907)
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.
2026-08-18 15:30:45 +02:00
Martin Hauser f35702728b
test(ui): Add test coverage for NestedObjectAttr
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
2026-08-18 14:49:59 +02:00
Jeremy Stretch 93f16a536d
Fixes #22923: Fix post-exception cleanup under event_tracking() (#22926) 2026-08-13 19:56:23 +02:00
Martin Hauser 752dc33ba6 ci(release): Pin metadata tooling to match publishing action
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
2026-08-13 13:54:09 -04:00
github-actions 0171c0ce5a Update source translation strings 2026-08-13 05:30:28 +00:00
Sri Chandraja Reddy Allala e9405d8f47
Fixes #22683: Prevent server errors when bulk import validation references an omitted field (#22784)
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.
2026-08-12 23:22:52 +02:00
github-actions f903cbf41d Update source translation strings 2026-08-12 05:29:58 +00:00
bctiemann a08d9f13fc
Merge pull request #22867 from netbox-community/22812-script-delete-memory-exhaustion
Closes #22812: Avoid loading all jobs into memory when deleting a JobsMixin object
2026-08-11 19:17:15 -04:00
Jeremy Stretch 3db98de783 Release v4.6.8 2026-08-11 09:37:13 -04:00
Jeremy Stretch 257c322e48 Revert "Fixes #22854: Set USE_SHADOW_DOM=False to fix GraphiQL queries w/debug enabled"
This reverts commit 30d2c9b537.
2026-08-11 09:37:13 -04:00
Arthur Hanson a94878aa08
22745 - Enforce object permissions on Script REST API write operations (#22777) 2026-08-11 08:09:13 -04:00
github-actions a7cf21a068 Update source translation strings 2026-08-11 05:23:07 +00:00
bctiemann ae8fa4c074
Merge pull request #22870 from netbox-community/22852-scripts-run-from-event-rules-ignore-notifications_default
Fixes #22852: Honor Custom Script execution defaults for Event Rules and `runscript`
2026-08-10 14:02:25 -04:00
Jeremy Stretch a4dcd82606
Fixes #22894: Sanitize error message rendered during exception in CustomLinkColumn (#22895) 2026-08-10 19:47:36 +02:00
Graham fca786bdf2
Closes #22502: Add direct unit tests for is_api_request() and is_graphql_request() (#22880) 2026-08-10 09:56:44 -05:00