Commit Graph

15476 Commits

Author SHA1 Message Date
Arthur 46f7293143 claude review cleanup 2026-05-28 16:36:47 -07:00
Arthur 499397139b #22270 - Skip cascade-deleted objects when clearing reverse SET_NULL relations 2026-05-28 15:43:21 -07:00
bctiemann 352860daf0
Fixes #22325: AttributeError when creating choice set with base choices (#22326)
CHOICE_SETS values (IATA, ISO_3166, UN_LOCODE) are lists of (value, label)
tuples, not dicts.  The .values() call introduced by #21984 treated them as
dicts, raising AttributeError: 'list' object has no attribute 'values' when
full_clean() was invoked during choice set creation.

Replace with a generator expression that extracts the first element from
each tuple, matching the same pattern used elsewhere in the same model.

Also covers the save() path when order_alphabetically=True but
extra_choices is None (base-only choice set), preventing a TypeError
when sorted() receives None.
2026-05-28 21:47:55 +02:00
Martin Hauser 3ee228f69a
Closes #22317: Clear background queues in tearDown for isolation (#22321) 2026-05-28 13:57:53 -05:00
Jeremy Stretch 4eb0e727b9
Fixes #22301: Avoid reverse relation name collision among tagged models (#22323) 2026-05-28 20:26:00 +02:00
Martin Hauser 9930245f44 test(extras): Use cleanup handlers for config test teardown
Replace manual `clear_config()` and `cache.clear()` calls at test end
with `addCleanup()` registered in `setUp()`. Ensures cleanup runs even
if assertions fail mid-test, preventing Redis pollution across tests.

Fixes #22290
2026-05-28 12:57:30 -04:00
Martin Hauser 4b1dc729e0 fix(extras): Use ContentTypeFilter for EventRule action_object_type
Change action_object_type field in EventRuleFilter from StrFilterLookup
to ContentTypeFilter for proper content type filtering in GraphQL API.

Fixes #22287
2026-05-28 12:52:59 -04:00
Martin Hauser 77a991711e
fix(graphql): Make ConfigContextProfile filter fields optional (#22313) 2026-05-28 08:47:26 -07:00
bctiemann 1c3ddcd97a
Closes #22305: Allow test cases to declare a stable query-count key prefix (#22306)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 10:41:37 -05:00
Martin Hauser 8f5d54c284
test(extras): Clear RQ queue after event rule tests
Add tearDown method to empty the default queue after each test. Prevents
leftover jobs from leaking into later test suites that may reuse
the same queue instance.

Fixes #22319
2026-05-28 17:37:53 +02:00
Jeremy Stretch 8a8c7ee7f3
Fixes #22283: Improve resolution of file path for imported S3 objects (#22284) 2026-05-28 08:29:26 -07:00
Jeremy Stretch 877ba8bf9e
Fixes #22187: Fix cable trace when entering profiled cable via single-position pass-through ports (#22316) 2026-05-28 10:02:03 -05:00
Jeremy Stretch 004178a299 Fixes #21091: Correct OpenAPI schema for rendering config contexts 2026-05-28 09:50:20 -04:00
Jeremy Stretch ae8bc6e6a2
Fixes #22307: Ensure consistent treatment of grant_token in web UI (#22308) 2026-05-28 15:07:58 +02:00
github-actions 99b3e7873b Update source translation strings 2026-05-28 06:23:28 +00:00
bctiemann de5d12860b
Merge pull request #22304 from netbox-community/21945-duplicate-migration-indexes-test
Closes #21945: Introduce a test for duplicate migration indexes
2026-05-27 15:30:21 -04:00
bctiemann 3b21753cfb
Merge pull request #22285 from netbox-community/22283-ScriptResultView-queryset
Fixes #22283: Restrict ScriptResultView queryset to current user
2026-05-27 15:27:48 -04:00
Jeremy Stretch 6e7211e27f Closes #21945: Introduce a test for duplicate migration indexes 2026-05-27 15:01:39 -04:00
Jeremy Stretch 7022bb7eac
Closes #22109: Add template object counts to ModuleType representation in REST & GraphQL APIs (#22302) 2026-05-27 09:38:47 -07:00
github-actions d13f5e8214 Update source translation strings 2026-05-27 06:28:59 +00:00
Arthur 63e1da416c #21902 - upgrade to django-tables2 v3.0 2026-05-26 15:45:32 -04:00
Jeremy Stretch 4d8dbc6ffe
Closes #22212: Support for exposing environment parameters in Jinja template context (#22289) 2026-05-26 13:47:04 -05:00
Jeremy Stretch 88eac5b37d
Closes #22239: Rename apply button for table configs (#22266) 2026-05-26 08:47:57 -07:00
Jeremy Stretch 19451649fa Fixes #22283: Restrict ScriptResultView queryset to current user 2026-05-26 11:27:02 -04:00
Jeremy Stretch a89feaf856 Closes #22090: Extend test cases to analyze the number of SQL queries executed 2026-05-26 09:10:03 -04:00
bctiemann 648d56010d
Closes: #19336 - Replace JS interface table toggles with server-side URL filters (#22263) 2026-05-26 08:38:10 -04:00
github-actions 2a19eb9901 Update source translation strings 2026-05-23 06:01:24 +00:00
mburggraf 57e7884d83
Closes #21261: add quick_add parameter to ObjectVar (#22271) 2026-05-22 13:38:58 -05:00
Arthur 7fff472436 review feedback 2026-05-22 14:12:17 -04:00
Arthur 97be961df7 Scope serializer resolvers per-app and drop default discovery path
Address review feedback on #22253:

- Registry stores resolvers as {app_label: resolver} dict instead of a
  flat list, so each app can only register a resolver for its own models.
- register_serializer_resolver() now takes (app_label, resolver) and
  get_serializer_for_model() only consults the resolver registered for
  the model's own app.
- Remove 'serializer_resolver' from DEFAULT_RESOURCE_PATHS so this niche
  resource is loaded only when a plugin explicitly defines it. The
  PluginConfig.ready() path imports the configured path directly and
  registers it under self.label.
- Update tests for the new per-app scoping; verify a resolver registered
  for one app does not affect lookups in another.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 14:12:17 -04:00
Arthur ff26cbd521 cleanup 2026-05-22 14:12:17 -04:00
Arthur 42d0d4458a cleanup 2026-05-22 14:12:17 -04:00
Arthur b09e8a1808 cleanup 2026-05-22 14:12:17 -04:00
Arthur 0499bb7616 allow plugins to override get_model_serializer 2026-05-22 14:12:17 -04:00
Josh Niec cfdf22fc18 fix: linting 2026-05-22 14:08:05 -04:00
Josh Niec 396a9a6ebe fix: make id field required in bulk patch/put open api schema 2026-05-22 13:09:22 -04:00
bctiemann 659d6d1f85
Closes #17127: Add user preference for metric/imperial measurements (#22246)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-22 11:16:10 -05:00
Jeremy Stretch 19df80fe77
Fixes #22233: Fix site & location filtering for cables connecting circuit terminations (#22262) 2026-05-22 09:17:28 -05:00
Jeremy Stretch a8f609bf21
Closes #21952: Improve robustness of RQ worker check (#22234) 2026-05-22 16:00:18 +02:00
Jeremy Stretch adc5b79330
Fixes #22232: Avoid enqueuing duplicate housekeeping jobs on startup (#22258) 2026-05-22 15:56:22 +02:00
bctiemann dbb7575564
Merge pull request #22267 from netbox-community/22241-yarn-validate
Closes #22241: Enforce formatting when running `yarn validate`
2026-05-22 09:21:54 -04:00
bctiemann 59678d0ca5
Merge pull request #22257 from netbox-community/22219-required-inline-fields
Fixes #22219: Label inline fields as required if any individual field is required
2026-05-22 09:21:06 -04:00
bctiemann 2580b321a3
Closes #19460: Support {lat}/{lon} placeholders in MAPS_URL (#22243)
Add support for literal `{lat}` and `{lon}` placeholders in `MAPS_URL`
when rendering GPS coordinate links. Existing configurations continue to
work by falling back to appending `lat,lon` when no coordinate placeholders
are present.

Move map URL handling into shared UI helpers so `GPSCoordinatesAttr` and
`AddressAttr` use consistent placeholder detection. When `MAPS_URL` contains
coordinate placeholders, suppress address-based map links to avoid rendering
invalid URLs.

Add tests for placeholder replacement, decimal coordinate values, fallback
behavior, and address link suppression. Also document the address link behavior
in the `MAPS_URL` configuration description.
2026-05-22 12:35:14 +02:00
github-actions 85e5e412bb Update source translation strings 2026-05-22 06:21:00 +00:00
Jeremy Stretch 490ccd482d Closes #22241: Enforce formatting when running yarn validate 2026-05-21 13:44:32 -04:00
Brian Tiemann fdb5eb142b Fix test_rename_select_all_spans_pages missing field_names
The new "select at least one field" guard fires when rename_fields is set
and no field_names are submitted. Add field_names=['name'] to both the
preview and apply POST data so the test exercises the intended rename path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 11:25:54 -04:00
Brian Tiemann a3b50b4198 Guard against rename_fields=None in submitted comprehension
The `submitted` list comprehension previously called `f in self.rename_fields`
which raises TypeError when a subclass sets rename_fields=None. Short-circuit
with `self.rename_fields and` to safely handle None, empty tuple, and populated
tuples uniformly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 11:25:54 -04:00
Brian Tiemann 9e909a9267 Address review issues 1 and 3: no-field guard and remove new_name shim
- Add form error when all field checkboxes are unchecked on submit;
  previously fell back to renaming every declared field silently
- Remove obj.new_name backward-compat assignment; no template or
  documented plugin API references it (all use obj.new_names now)
- Update base test data to include field_names=['name'] so the guard
  does not fire in views-framework tests that don't specify fields

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 11:25:54 -04:00
Brian Tiemann 6d628ffbb6 Fix template indentation 2026-05-21 11:25:54 -04:00
Brian Tiemann 91f779b661 Address PR review: reorder field checkboxes, fix indentation, add simultaneous-field test
- Move field checkboxes before the find/replace/use_regex inputs so they
  are not visually conflated with the 'use regex' checkbox
- Fix indentation inside the {% if rename_fields %} block
- Add trailing newline to bulk_rename.html
- Add test_bulk_rename_name_and_label_fields to verify that submitting
  field_names=['name', 'label'] updates both fields simultaneously

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-21 11:25:54 -04:00