Commit Graph

15866 Commits

Author SHA1 Message Date
github-actions ff50ad8ae2 Update source translation strings 2026-07-09 06:18:24 +00:00
Brian Tiemann d1310ed580 Address PR #22646 review findings from automated reviewer
- Security: remove object names/PKs from ProtectedError detail; report count only
  to avoid exposing objects the caller may lack permission to view
- i18n: wrap new error detail strings with _().format() to match codebase convention
- Redundancy: remove superfluous `results and` guard in bulk_destroy (any() on an
  empty list already returns False)
- Comment: explain that SequentialBulkCreatesMixin continues provisionally creating
  after a failure so cross-object validators see a realistic state

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-08 18:42:05 -04:00
Brian Tiemann 94197efcfb Improve test_bulk_create_objects_validation_error with mixed ok/error case
Use a valid first item (create_data[0]) alongside an invalid second item ({})
so the test exercises both the 'ok' result shape and the atomic rollback of an
item that would otherwise have been persisted.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-08 18:11:34 -04:00
Brian Tiemann d8506f178e Address PR review feedback for #20054 bulk error correlation
- Use pre-captured `pk` consistently in perform_bulk_destroy error path
- Add comment clarifying the `if results:` sentinel in bulk_update
- Add per-field atomicity assertion to test_bulk_update_objects_validation_error
- Use ID-keyed dict instead of positional index in test_bulk_delete_objects_protected

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-08 18:04:44 -04:00
Brian Tiemann 3d8f8289d9 Closes #20054: Return per-object error details for failed bulk operations
Bulk update (PATCH), sequential bulk create (POST), and bulk delete (DELETE) on
list endpoints now collect per-object errors instead of aborting on the first
failure. When any objects fail, the entire operation is rolled back atomically
and a 400/409 response is returned with a structured payload:

  {
    "detail": "1 of 3 objects failed validation.",
    "results": [
      {"id": 1, "status": "ok"},
      {"id": 2, "status": "error", "errors": {"name": ["..."]}},
      {"id": 3, "status": "ok"}
    ]
  }

For bulk creates via SequentialBulkCreatesMixin the correlator is "index"
(zero-based position in the request list) since no IDs exist yet. For bulk
delete the status code remains 409 and the correlator is "id".

Successful operations are unchanged (200/201/204).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-08 17:10:25 -04:00
Arthur Hanson c3bc1fb04a
#22231 - Add nulls-first parameter for custom field ordering (#22476) 2026-07-08 11:45:53 -07:00
Arthur f9b5df87c5 fix 2026-07-08 10:45:34 -07:00
Jeremy Stretch 1391e5185f
Closes #22636: Feature plugins in the README & installation docs (#22638) 2026-07-08 09:37:32 -07:00
bctiemann 800db5727f
Closes #18821: Simplify setting/updating primary MAC through interface model (#22520) 2026-07-08 09:31:16 -07:00
Jeremy Stretch 9ee38b6c1a
Fixes #22617: Editing objects via bulk import form requires "change" permission (#22618) 2026-07-08 10:23:00 -05:00
Arthur Hanson 2f604551c1
Closes #22571: Migrate from django-pglocks to django-pgware (#22635) 2026-07-08 10:19:05 -05:00
Martin Hauser 3561de3d56 fix(auth): Support proxy models in Object Permission checks
Replace ValueError with graceful permission denial when checking
permissions against proxy models or invalid model references. Evaluate
constraints via the permission model's manager and log warnings for
nonexistent models or debug messages for model mismatches.

Fixes #22632
2026-07-08 09:56:19 -04:00
github-actions 46de424447 Update source translation strings 2026-07-08 05:58:42 +00:00
Arthur 6fece9cfc2 fix 2026-07-07 16:42:39 -07:00
bctiemann b620be0f46
Merge pull request #22631 from netbox-community/22615-webhooks-drop-request_id-username
Closes #22615: Remove legacy request_id and username parameters from webhook context
2026-07-07 15:45:49 -04:00
bctiemann 4919be6c00
Merge pull request #22628 from Amir-Bakar/22539-fix-available-ips-constrained-permissions
Fixes #22539: Restore available IP display for users with constrained…
2026-07-07 14:56:54 -04:00
Arthur 3f077df77f #22205 - Add EOL to DeviceType, ModuleType 2026-07-07 10:26:38 -07:00
Martin Hauser 0663ea1a47 test(dcim): Add test coverage for Connection list views
Add test cases for Console, Power, and Interface Connection list views.
Include query count baselines and shared mixin for read-only connection
views that filter by complete cable paths.

Fixes #22577
2026-07-07 12:51:27 -04:00
Jeremy Stretch 52a8e6a48d
Fixes #22566: Avoid name collisions when custom script name matches core module (#22625) 2026-07-07 09:18:34 -07:00
Jason Novinger 9f47700e23
Closes #22538: Add security note for HTTP_CLIENT_IP_HEADERS client-IP trust (#22614)
* Fixes #22538: Add security note for HTTP_CLIENT_IP_HEADERS client-IP trust

* Clarify header naming and leftmost-address behavior in client IP warning
2026-07-07 09:09:50 -07:00
Jeremy Stretch 58e8068958
#21355: Refactor trigger migrations (#22608) 2026-07-07 09:04:45 -07:00
Jeremy Stretch 80c81230a4 Closes #22615: Remove legacy request_id and username parameters from webhook context 2026-07-07 11:13:09 -04:00
Jeremy Stretch 54eda421fb
Closes #22629: Lower maximum uploaded image size to 50M pixels (#22630) 2026-07-07 16:52:38 +02:00
Jeremy Stretch df83277156
Closes #22607: Sanitize HTTP requests passed to template contexts for custom links (#22616) 2026-07-07 08:59:24 -05:00
Jeremy Stretch 98d9366586
Fixes #22626: Ensure Custom Link names are escaped when rendering fails (#22627) 2026-07-07 15:49:36 +02:00
Amir Bakar 34c21d3d69 Fixes #22539: Restore available IP display for users with constrained permissions 2026-07-07 15:15:28 +02:00
github-actions c5bcea2b99 Update source translation strings 2026-07-07 06:20:28 +00:00
bctiemann a6da836df8
Merge pull request #22580 from netbox-community/21712-static-select-descriptions
Closes #21712: Support description annotations for static choice form fields
2026-07-06 14:47:18 -04:00
Jeremy Stretch 2c74c0c2a4
Fixes #22573: Remove persistent scrollbar on nav menu in Chrome (#22601) 2026-07-06 12:36:37 -05:00
Jeremy Stretch a9da727ffc
Fixes #22598: Fix ValueError exception when viewing background tasks (#22612) 2026-07-06 10:18:20 -05:00
Graham 20605be859
Fixes #22500: Use passed error kwarg in handle_rest_api_exception() (#22562) 2026-07-06 09:54:22 -05:00
Jeremy Stretch a907ba2062
#21992: Additional cleanup (#22594) 2026-07-06 09:45:45 -05:00
Jeremy Stretch 9c3fb57a93
Fixes #22568: Fix ValueError exception when receiving an invalid `filter_id` value (#22602) 2026-07-06 09:41:31 -05:00
Lasse Haugen 9189067f3e Fix harsh interface row separators in dark mode
#22018 switched the row separator on highlighted interface rows to an
opaque colour so it stays visible against tinted backgrounds, but
hardcoded $gray-300 (--tblr-gray-300), a light-theme grey. Because
tr[data-cable-status] matches every interface row, in dark mode this
paints a harsh bright line on every row. Override the separator colour
in dark mode with the theme-aware --tblr-border-color so it stays
visible on tinted rows without being jarring. Light mode is unchanged.
2026-07-05 12:08:58 -04:00
github-actions a835fe216e Update source translation strings 2026-07-04 06:02:43 +00:00
Ciro Iriarte 945634724b
Closes #18828: Add MDC fiber connector to the list of available port types 2026-07-03 19:57:00 -04:00
Jeremy Stretch 6edb5ec8b7
Fixes #22578: Ensure shared objects are treated consistently across the UI and APIs (#22606)
- Annotate the `info` parameter in SharedObjectMixin.get_queryset() with
  the Info type for consistency with BaseObjectType.get_queryset()
- Extend the SavedFilter and TableConfig visibility tests to assert that
  the owning user can still retrieve their own private object via both the
  REST detail endpoint and GraphQL
2026-07-03 20:35:45 +02:00
github-actions d9ccee6ef2 Update source translation strings 2026-07-03 06:11:10 +00:00
Jeremy Stretch 2904ee29df
Document NetBox's threat model (#22575) 2026-07-03 00:10:07 +02:00
Jeremy Stretch a7be755e01 Closes #21712: Support description annotations for static choice form fields 2026-07-02 13:46:43 -04:00
Jeremy Stretch 48ce5e7e2c
Closes #22446: Add breadcrumbs support for Layouts (#22546) 2026-07-02 10:46:01 -05:00
mburggraf c56090f994
Fixes #22521: Honor RAM_BASE_UNIT for Virtual Machine Type default memory (#22550)
Update VirtualMachineType default memory labels and display rendering to use
the configured RAM base unit, matching the existing VirtualMachine and
VirtualDisk behavior.

Render default memory with the existing humanized RAM capacity helper and
keep the model field metadata unit-agnostic.

---------

Co-authored-by: Martin Hauser <mhauser@netboxlabs.com>
2026-07-02 13:51:18 +02:00
Jeremy Stretch e727da5cad Work around an MDX rendering error
Working around an MDX compilation failure that occurs when consuming the documentation externally
2026-06-30 17:35:52 -04:00
Arthur Hanson 7a1dfb58e3
Fixes #22154: Correct OpenAPI schema regarding relation counts for nested objects 2026-06-30 16:05:35 -04:00
jkburges 614d50a564
Add prefetch hint for GraphQL tags on list endpoints (#22570)
GraphQL list queries that request tags were issuing one tag lookup query
per object (N+1). TagsMixin declared the field without a prefetch hint;
django-taggit's M2M is not batched by DjangoOptimizerExtension the way
GenericRelations are. Add prefetch_related=['tags'] on the mixin field,
following the pattern from #22061 for journal entries and image
attachments.

Closes #22551
2026-06-30 10:13:49 -07:00
Jeremy Stretch 9ed112b89d #21326: Fix tests for updated VC search behavior 2026-06-30 12:40:54 -04:00
Jeremy Stretch d28f0a2114 Merge branch 'main' into feature
Resolved conflicts:
- Dropped 4.7 deprecation shims (FutureWarning getattr/methods) re-introduced
  by main, which feature has already removed: pagination, constants, registry,
  forms utils/expandable, settings (Sentry), generic view mixins.
- dcim/signals.py: kept main's search-cache-on-VC-rename handler; dropped
  Prefix/Cluster/WirelessLAN imports for the scope-sync handler feature replaced
  with PostgreSQL triggers.
- extras test_management_commands.py: unioned ConfigContext + ImageAttachment
  imports.
- Rebuilt project-static dist bundles (netbox.js/.map/.css) from merged source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 11:32:37 -04:00
Jeremy Stretch 3d73b2a166 Release NetBox v4.6.4 2026-06-30 11:23:11 -04:00
Martin Hauser 1a12f687ee fix(extras): Conditionally render saved filter dropdown
Only display the saved filter dropdown in table controls when a filter
form is present and includes a filter_id field. This prevents rendering
an empty or non-functional dropdown when saved filters are unavailable.
2026-06-30 11:21:19 -04:00
Martin Hauser 8c898e7713 fix(navigation): Normalize default menu button color
Render navigation menu buttons with the secondary ghost style when their
color is unset or set to the default choice.

This fixes plugin menu buttons, which default to "default" rather than
None, while preserving explicitly configured button colors.
2026-06-30 11:21:19 -04:00