Commit Graph

15339 Commits

Author SHA1 Message Date
mburggraf 583ab535e8
Fixes #22358: Remove broken and unused function get_0u_devices (#22368) 2026-06-03 13:08:21 +02:00
github-actions 120700688c Update source translation strings 2026-06-03 06:34:32 +00:00
bctiemann c1d69ebae6
Merge pull request #22275 from jniec-js/main
Closes: #22245: Fix OpenAPI request schemas for bulk update endpoints
2026-06-02 21:19:42 -04:00
Josh Niec c3d8b14a3d fix: address pr comments 2026-06-02 19:51:42 -04:00
Josh Niec 56ac8030b8 fix: address pr comments 2026-06-02 19:48:37 -04:00
Josh Niec c264b42abc fix: avoid problem when fields is set to '__all__' 2026-06-02 18:37:24 -04:00
Josh Niec 1597f1bd7d fix: linting 2026-06-02 18:30:10 -04:00
Josh Niec 208dd9b05b fix: address pr comments 2026-06-02 18:28:45 -04:00
Martin Hauser 5561deb1e4 fix(dcim): Refresh cable path for endpoints loaded before tracing
Repair stale `_path` references when an endpoint instance is cabled but
has no path set, as occurs during cable creation before path tracing.
The `path` accessor now refreshes the denormalized FK from the database
in this case, ensuring event payloads include connected endpoints.

Fixes #21338
2026-06-02 16:41:53 -04:00
Martin Hauser 3172e47904
Fixes #22210: Respect filters when rendering IPAM child availability views (#22327)
* fix(ipam): Honor filters for child availability views

Retain the instantiated child FilterSet on ObjectChildrenView and expose
whether child object filters are active. Use this in IPAM child views to
avoid rendering synthetic availability rows when the child queryset has
been filtered.

This ensures Saved Filters and direct filters are respected on
Prefix IP Address, Child Prefix, Aggregate Prefix,
and VLAN Group VLAN tabs.

Fixes #22210

* refactor(ipam): Replace has_active_filters with ChildAvailabilityMixin

Extracts filter detection logic from ObjectChildrenView into a dedicated
ChildAvailabilityMixin. Compares WHERE clause signatures between
filtered and unfiltered querysets instead of inspecting filter
parameters, improving reliability when child querysets are pre-scoped
to parent objects.
2026-06-02 16:30:17 -04:00
bctiemann b1ebd93349
Merge pull request #22365 from netbox-community/22340-token-allowed_ips-list
Fixes #22340: Correct display of allowed IPs for tokens in web UI
2026-06-02 14:21:27 -04:00
Jeremy Stretch 5b08541242 Fixes #22340: Correct display of allowed IPs for tokens in web UI 2026-06-02 12:39:05 -04:00
Jeremy Stretch 839259ccec
Closes #22361: Introduce ArrayAttr UI panel attribute (#22362) 2026-06-02 18:17:02 +02:00
Maksym-Ototiuk fc17d468aa Closes #21666: Add MU fiber connector type 2026-06-02 12:01:26 -04:00
bctiemann 35450a6cb8
Fixes #22251: Re-parent child ModuleBays when a Module is moved to a new bay (#22336) 2026-06-02 08:25:56 -07:00
Jeremy Stretch b55b50b12e
CAP-122: Add GitHub workflow to close new issues missing labels (#22356) 2026-06-02 16:43:52 +02:00
Jeremy Stretch 742f4b4330 Release v4.6.2 2026-06-02 10:11:34 -04:00
Jeremy Stretch 0ea6e334a0 Revert "Fixes #22310: Restore tracked placeholder in project-static/docs to prevent staticfiles warning (#22337)"
This reverts commit a72ab9007e to fix the pre-commit workflow.
2026-06-02 09:44:15 -04:00
bctiemann 5b5e821fbb
Merge pull request #22348 from netbox-community/22180-custom-script-data-source-bypass
Closes #22180: Validate scripts added via a data source
2026-06-02 06:56:46 -04:00
Jason Novinger e44d5d3855 Drop issue reference from data source validation comment
Per AGENTS.md conventions, comments should not reference the current
task or issue number, which rot as the codebase evolves.
2026-06-02 12:03:35 +02:00
Jason Novinger 0ba2fdade0 Fixes #22180: Validate scripts added via a data source
ScriptFileForm only validated uploaded scripts, so a script added by
selecting a data file bypassed validate_script_content. A script that
failed to load was committed as a broken module that showed as missing
and could not be corrected, since re-adding it tripped the file path
uniqueness constraint.

Validate the data file's content in the form's clean() the same way
uploaded files are validated, so a script that cannot be loaded is
rejected before any module is created.
2026-06-02 11:49:59 +02:00
github-actions 03fc20d202 Update source translation strings 2026-06-02 06:31:16 +00:00
Jason Novinger 8c2c6f2349
Fixes #22158: Cache empty config revision state to avoid per-request queries (#22342)
When no ConfigRevision exists, the empty state was never cached, so every
request re-queried core_configrevision. Distinguish a genuine cache miss from
a cached-empty state via a sentinel, seed the empty state on first load, and
only consult the database on a true miss.

Treat the cache as warm only when both 'config' and 'config_version' are
present. A missing 'config_version' (evicted or never written) now re-queries
the database instead of leaving Config.version as None when a ConfigRevision
exists. The no-revision branch writes both keys, so the intentional empty
state remains a cache hit.

The config tests shared a single Redis instance (keyed only by a static
prefix) across parallel test workers, so a no-revision test in one worker
could seed empty config/config_version keys that another worker's test then
read, causing intermittent failures. Use a per-process LocMemCache so the
shared cache keys cannot be contaminated across workers.
2026-06-01 20:18:30 +02:00
Martin Hauser 6724c29ffb
test(core): Clear RQ queues before and after tests (#22320)
Add RQQueueTestMixin to centralize RQ queue cleanup for test cases that
interact with background jobs. The mixin clears all RQ queues in setUp()
and tearDown(), preventing jobs created by one test from leaking into
later unrelated test runs.

Replace duplicate queue cleanup logic in core and netbox tests with the
shared mixin for better maintainability.

Fixes #22318
2026-06-01 10:10:13 -07:00
Martin Hauser bcfeb762e8 refactor(tests): Rename test base classes for clarity
Rename `CablePathTestCase` to `BaseCablePathTestCase` and
`JobRunnerTestCase` to `BaseJobRunnerTestCase` to clearly indicate
their role as abstract base classes rather than concrete test cases.

Fixes #22338
2026-06-01 08:58:21 -04:00
Jason Novinger a72ab9007e
Fixes #22310: Restore tracked placeholder in project-static/docs to prevent staticfiles warning (#22337) 2026-06-01 14:31:51 +02:00
bctiemann bc75706b24
Fixes #22328: Add missing else branch to DynamicMultipleChoiceField.get_bound_field() (#22329) 2026-05-29 09:23:01 -04:00
github-actions fd35c36901 Update source translation strings 2026-05-29 06:24:30 +00:00
bctiemann cc78ebf347
Merge pull request #22331 from netbox-community/22270-delete
#22270 - Skip cascade-deleted objects when clearing reverse SET_NUL relations
2026-05-28 20:05:30 -04:00
bctiemann 14f5a2ed7c
Merge pull request #22322 from netbox-community/22319-eventruletestcase-lacks-teardown-leaks-enqueued-events
Closes #22319: Clear RQ queue after Event Rule tests
2026-05-28 20:03:42 -04:00
bctiemann 14c3c573e3
Merge pull request #22314 from netbox-community/21091-render-config-openapi
Fixes #21091: Correct OpenAPI schema for rendering config contexts
2026-05-28 20:02:59 -04:00
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