Commit Graph

14956 Commits

Author SHA1 Message Date
Arthur
83fb0a6379 Align API validation messages with UI; restore complete checks
- Match UI error messages for upload+data_file conflict and no-source case
- Keep API-only guards for upload+data_source and data_source-without-data_file
- Restore test_upload_with_data_source_fails

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 15:40:14 -07:00
Arthur
cf41c45a26 Revert "Align ManagedFileForm validation with API serializer rules"
This reverts commit f0ac7c3bd2.
2026-03-30 15:38:38 -07:00
Arthur
f0ac7c3bd2 Align ManagedFileForm validation with API serializer rules
Add the missing checks to ManagedFileForm.clean():
- upload_file + data_source is rejected (matches API)
- data_source without data_file is rejected with a specific message
- Update the 'nothing provided' error to mention data source + data file

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 15:37:58 -07:00
Arthur
f9af8e2068 Require data_file when data_source is specified
data_source alone is not a valid creation payload — a data_file must
also be provided to identify which file within the source to sync.
Add the corresponding validation error and a test to cover the case.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 15:36:51 -07:00
Arthur
3bd2dbea86 Validate upload_file + data_source conflict for multipart requests
DRF 3.16 Serializer.get_value() uses parse_html_dict() or empty for all
HTML/multipart input. A flat key like data_source=2 produces an empty
dict ({}), which is falsy, so it falls back to empty and the nested
field is silently skipped. data.get('data_source') is therefore always
None in multipart requests, bypassing the conflict check.

Fix: also check self.initial_data for data_source and data_file in all
three guards in validate(), so the raw submitted value is detected even
when DRF's HTML parser drops the deserialized object.

Add test_upload_with_data_source_fails to cover the multipart conflict
path explicitly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 15:35:28 -07:00
Arthur
c5d911c48b Return 400 instead of 500 on duplicate script module upload
Catch IntegrityError from the unique (file_root, file_path) constraint
and re-raise as a ValidationError so the API returns a 400 with a clear
message rather than a 500.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 15:20:38 -07:00
Arthur
c4077bf0eb Fix permission check, perform_create delegation, and test mock setup
- destroy() now checks extras.delete_script (queryset is Script.objects.all())
- create() delegates to self.perform_create() instead of calling serializer.save() directly
- Add comment explaining why update/partial_update intentionally return 405
- Fix test_upload_script_module: set mock_storage.save.return_value so file_path
  receives a real string after the _save_upload return-value fix; add DB existence check

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-30 14:55:52 -07:00
Arthur
40f31205f2 review feedback: 2026-03-30 14:32:03 -07:00
Arthur
ad2dd3cc85 review feedback: 2026-03-30 14:21:31 -07:00
Arthur
df216cc0f1 review feedback: 2026-03-30 14:05:13 -07:00
Arthur
2a2f36c1ba Merge branch 'main' into 21701-script 2026-03-30 13:58:15 -07:00
bctiemann
e54ed87863 Merge pull request #21778 from netbox-community/21763-m2m-form-fields
Fixes #21763: Replace M2M selection field with separate add/remove fields
2026-03-30 11:23:36 -04:00
Jeremy Stretch
55daf4c52f Add/fix tests 2026-03-30 10:02:38 -04:00
Jeremy Stretch
a45e8571da Revert changes to ASNForm 2026-03-30 09:29:08 -04:00
Jeremy Stretch
0154a09856 Limit 'add' field choices to objects not already assigned 2026-03-30 09:22:56 -04:00
Jeremy Stretch
757c4f69d2 Annotate current number of assignments if >100 2026-03-30 09:15:35 -04:00
Jeremy Stretch
d5f37d7a87 Use add/remove fields only when assignment count is 100+ 2026-03-30 09:07:15 -04:00
Jeremy Stretch
f30786d8fe Fixes #21763: Replace M2M selection field with separate add/remove fields 2026-03-27 16:45:36 -04:00
github-actions
bb73601d80 Update source translation strings 2026-03-27 05:31:05 +00:00
Arthur Hanson
99e9d96787 #20923: Migrate IPAM views to declarative layouts (#21695)
* #20923: Migrate IPAM views to declarative layouts

* #20923: Migrate IPAM views to declarative layouts

* fix VRF view

* fix Route Target view

* fix addressing details modal

* fix add prefix button

* fix add aggregate button

* fix add VLAN button

* fix breadcrumb on Application Service

* fix breadcrumb on ANS

* move attrs to separate file

* review feedback

* review feedback

* review feedback

* review feedback
2026-03-26 16:55:12 -04:00
bctiemann
f5c97e367c Merge pull request #21754 from netbox-community/20923-core-ui-layouts
#20923: Migrate core app to the new UI layouts
2026-03-26 13:53:20 -04:00
Arthur
4fa31f93ca ruff fix 2026-03-26 09:57:11 -07:00
Arthur
57128e539a change to use Script api endpoint 2026-03-26 09:44:18 -07:00
Arthur Hanson
ea756b29e9 #20923 - Convert tenancy to new UI layout (#21745) 2026-03-26 17:16:31 +01:00
Jeremy Stretch
b929e1aa1b Fixes #21747: Skip search caching when encountering an invalid schema during migrations (#21748) 2026-03-26 09:13:28 -07:00
github-actions
91d5382a61 Update source translation strings 2026-03-26 05:30:51 +00:00
Arthur
262761caa9 add extra test 2026-03-25 15:17:52 -07:00
Arthur
b34a7d1265 #21701 allow upload script via API 2026-03-25 14:33:11 -07:00
Arthur
5043b9c96b #21701 allow upload script via API 2026-03-25 14:32:47 -07:00
Mark Robert Coleman
e76203238d Fix {module} placeholder resolution in module bay position field (#21752)
* Fix {module} placeholder resolution in module bay position field (#20467)

The {module} placeholder in ModuleBayTemplate's position field was not
being resolved when a module was installed, leaving the literal string
"{module}" in the position. This adds a resolve_position() method and
calls it in instantiate(), consistent with how resolve_name() and
resolve_label() already work.

Consolidates the shared resolution logic into _resolve_module_placeholder()
to eliminate duplication across resolve_name, resolve_label, and the new
resolve_position.

Fixes: #20467

* Move resolve_position() to ModuleBayTemplate

---------

Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
2026-03-25 15:45:49 -04:00
Jeremy Stretch
3f58648115 Convert DataFileView to a single-column layout 2026-03-25 13:55:07 -04:00
Jeremy Stretch
b904dc5c75 Support translation of headings for embedded table panels 2026-03-25 13:50:41 -04:00
Jeremy Stretch
bf27ff9593 #20923: Initial work on migrating the core app 2026-03-25 12:57:10 -04:00
Martin Hauser
981f31304d Closes #21735: Replace deprecated Strawberry scalar for BigInt (#21736) 2026-03-25 09:36:30 -05:00
Martin Hauser
2a39ab47d6 feat(circuits): Add UI layout panels for circuits app
Implement comprehensive UI panel layouts for all circuit models using
the new panel system. Add panels for providers, circuits, terminations,
groups, and virtual circuits with proper attribute rendering and
actions.
2026-03-25 10:19:26 -04:00
Jeremy Stretch
aa01c16db0 #20923: Migrate remaining DCIM views to new UI layouts (#21706) 2026-03-25 09:08:54 -05:00
github-actions
e04986617c Update source translation strings 2026-03-25 05:28:00 +00:00
bctiemann
83cf193cdc Merge pull request #21680 from netbox-community/21664-update-github-actions-for-nodejs-24-compatibility
Closes #21664: Update and pin GitHub Actions for Node 24 compatibility
2026-03-24 14:34:57 -04:00
bctiemann
d497198f49 Merge pull request #21721 from netbox-community/21698-custom-field-url-filter-is-too-restrictive-for-weird-ports
Fixes #21698: Fix validation of custom field URLs with single-digit ports
2026-03-24 14:25:00 -04:00
pobradovic08
4e479c547f Closes #21480: Add 1.6T Ethernet interface types (#21723)
Add support for IEEE 802.3dj 1.6T fixed interface types and
published 1.6T pluggable form factors.

This adds 1.6TBASE-CR8, 1.6TBASE-KR8, 1.6TBASE-DR8, and
1.6TBASE-DR8-2, plus OSFP1600, OSFP1600-RHS, and QSFP-DD1600
transceiver types.
2026-03-24 10:51:26 +01:00
github-actions
e44c0a2119 Update source translation strings 2026-03-24 05:27:47 +00:00
Martin Hauser
3ab0613708 fix(circuits): Add ProviderAccount fieldsets (#21708) 2026-03-23 16:07:20 -07:00
Martin Hauser
9f16734266 fix(utilities): Allow single-digit port numbers in URL validator
Change port number regex from `\d{2,5}` to `\d{1,5}` to permit valid
single-digit ports (1-9). This aligns with RFC 3986 and fixes
validation for URLs using ports like :8 or :9.

Fixes #21698
2026-03-20 13:40:40 +01:00
github-actions
c3c7cf15b2 Update source translation strings 2026-03-18 05:28:51 +00:00
Jeremy Stretch
2b7049c39c Release v4.5.5 (#21672)
* Release v4.5.5

* Pin django-rq to <4.0
v4.5.5
2026-03-17 14:58:14 -04:00
Martin Hauser
3ededeb0e7 fix(circuits): Clear Circuit Termination cache on change
Move cache update logic from signal to model save method and track
original values to properly clear old cache when circuit_id or term_side
changes. Add comprehensive tests for all cache update scenarios.

Fixes #21686
2026-03-17 13:16:22 -04:00
bctiemann
66f6b2b6f9 Merge pull request #21649 from netbox-community/21556-fix-dropdown-clearing
Fixes #21556: Restore previous value (if applicable) after clearing related dropdown
2026-03-17 12:06:14 -04:00
Jeremy Stretch
61cef9400d Fixes #21556: Restore previous value (if applicable) after clearing related dropdown 2026-03-17 11:33:53 -04:00
Jonathan Senecal
d57f230f37 Fixes #21653: Fix multi-position tracing in CablePath.from_origin() (#21681)
* Add failing tests for multi-position cable path tracing

* Fix multi-position tracing in CablePath.from_origin()

* Add failing test for multi-connector trunk cable tracing through patch panel

* Fix multi-connector profiled cable tracing in CablePath.from_origin()
2026-03-17 14:16:03 +01:00
Rob Duffy
472dc3882e Fixes #21673: UI Bug with Displaying Primary IP Address with NAT IP on a VM 2026-03-17 08:54:03 +01:00