RQQueueTestMixin cleared RQ queues with FLUSHALL, which empties every
database on the Redis server — including the caching database, whose
'config'/'config_version' keys are shared by all parallel test workers.
A flush landing mid-test forces an unrelated worker to re-read
core_configrevision, adding two queries to the affected request. Flush
only the queue's own database instead.
Also stop GraphQLDeferredColumnTestCase from comparing total query counts
between two requests, which is what surfaced the race as intermittent
"Query count grew from 7 to 9" failures in CI. Assert that the target
table is read exactly once per request instead, as #23034 did for the
equivalent custom fields test.
Set `_terminations_modified` flag when recreating terminations to ensure
paths are rebuilt even when endpoints remain unchanged.
Reset `_orig_status`, `_orig_profile`, and `_terminations_modified`
after saving a cable to prevent repeated saves from recreating
terminations and paths.
Add comprehensive test coverage for profile changes, trunk regrouping,
and mid-span cables.
Validate the effective timeout and notification settings at the
ScriptJob enqueue boundary so invalid script configuration is reported
consistently across all execution paths instead of raising an unhandled
exception.
Preserve the inherited positional enqueue contract and prevent tests
from interfering through shared RQ queue state during parallel runs.
Introduces normalize_update_fields() utility to materialize one-shot
iterables like generators into frozensets, preventing bugs in save()
overrides that perform membership tests. Fixes channelization cascades,
module moves, and ltree parent tracking when using generator
expressions.
Fixes#23074
Recognize Django's ManyToManyRel in get_prefetches_for_serializer().
Because it is a sibling of ManyToOneRel rather than a subclass, reverse
many-to-many accessors were omitted from the generated prefetch paths and
fetched once per serialized object.
Add regression coverage for both automatically generated fields and
SerializedPKRelatedField(many=True), and regenerate the affected ASN and
ObjectPermission API query-count baselines.
Fixes#23060
Introduce `normalize_update_fields()` utility to convert update_fields
to frozenset, preventing one-shot iterables from being consumed during
membership tests. Update Service, VLANGroup, and CircuitTermination
save methods to use normalized fields. Add comprehensive test coverage.
Fixes generator exhaustion when save() overrides check field membership
before persisting denormalized caches alongside their source fields.
Fixes#23078
Move scope assignment before validation to prevent stale scope values
on instances when validation fails. Refactor VLANGroupForm to inherit
from ScopedForm, removing duplicate scope handling code. Add test
coverage for scope type changes and validation errors.
Fixes#23040
Serializers used only in a nested context have no complete form in the schema, so
prefixing them with "Brief" renamed an existing component to no purpose and dropped
the old name entirely. Exempt serializers declaring an explicit Meta.ref_name from
the prefix, and pin the three affected names.
This narrows the schema diff to the fields the bug actually affected: no components
are removed, and the nine which are added are purely additive.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Drop the non-BaseModelSerializer fallback in FixSerializedPKRelatedField.
SerializedPKRelatedField.to_representation() passes nested unconditionally, so a
serializer which doesn't accept it raises TypeError on every read; the branch
documented a component for a configuration the API cannot serve.
* Generate the OpenAPI schema once per class rather than once per test method.
* Exercise the component.ref and request-schema return paths, and use SimpleTestCase
for the tests which don't touch the database.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
FixSerializedPKRelatedField passed the serializer class to resolve_serializer(),
which instantiates it with no arguments. The field's nested setting was therefore
lost, and the generated response schema referenced the complete component (with
the complete field set) even where the field renders a brief representation.
Resolve an instance carrying the field's nested setting instead. Request schemas
are unaffected and continue to accept integer primary keys.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Teach _get_nested_serializer() to unwrap ManyRelatedField and resolve the
serializer configured on SerializedPKRelatedField. Preserve the field's
nested value so prefetch discovery follows brief_fields for nested
representations and the full field set otherwise.
Guard the recursion against reference cycles by tracking the serializer
states already being resolved on the current path. Because nested defaults
to False the target expands its full field set, so a self-referential or
mutually referential declaration would otherwise recurse without a
termination condition. The key pairs the serializer class with its
effective field set, since re-entering a serializer at a narrower depth is
finite rather than cyclic, and the states are copied per frame so a sibling
field can still expand what another one stops at.
Populate interface VDC relationships and VRF route target assignments in
the API test fixtures, update the two query count baselines, and add
coverage for direct, many-valued and non-nested serialized related fields
alongside self-referential, mutually referential, brief-depth and
sibling-reuse cases.
Fixes#22988
SideNav classified the viewport only during construction. Resizing past
the `lg` breakpoint therefore left the desktop sidebar in its previous
mobile state, and the menu group containing the current page remained
collapsed until the pointer entered the sidebar.
Use the existing desktop media query as an event source. Apply the
persisted pin preference directly to the body attributes during
initialization and on each breakpoint transition, then reinitialize the
active menu section.
Avoid calling `pin()` or `unpin()` during responsive transitions so
Bootstrap retains ownership of its collapse state and the stored
preference is not rewritten unnecessarily.
Also remove the `show` class from a menu group toggle when collapsing
its section to keep the toggle and menu state synchronized.
Fixes#23035
Move owner field from fieldsets to Meta.fields in PowerOutletForm and
add it to ServiceCreateForm Meta.fields. Ensures owner field appears in
forms and can be properly saved. Adds test coverage with Owner creation.
Fixes#23052
Replace NumberFilter with MultiValueNumberFilter for VLANGroup scope
filters (Region, Site Group, Site, Location, Rack Group, Rack,
Cluster Group, Cluster). Update filter_scope method to use `__in`
lookup and add comprehensive test coverage for multi-value filtering.
Fixes#22671
Render social authentication actions as POST forms to comply with
social-auth-app-django 6.0's POST-only begin view. Pass the `next` and
SAML `idp` parameters as hidden fields so they remain available to
`do_auth()`.
Preserve the post-login URL when the login page is re-rendered after a
failed password attempt, and avoid shadowing the request data while
enumerating SAML identity providers. Extend the tests to validate the
rendered SSO forms and their hidden parameters.
Storage backends such as S3 may return presigned URLs whose signature covers
the entire query string. Appending a version parameter to such a URL after it
has been signed invalidates the signature, causing the storage backend to
reject the request with a 403.
Return signed URLs unmodified. These embed an expiration and are regenerated
on each request, so they require no cache-busting parameter.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Reopens any issue that is closed as completed without a milestone
assigned, after a short grace period to allow for the milestone being
set immediately after closure.
Adds parent field to InterfaceTemplateImportForm to support channelized
interface imports. Filters parent queryset by device_type or module_type
during validation to prevent MultipleObjectsReturned errors when
resolving parent interfaces by name.
Fixes#23036
Store the vertical sidebar's scroll position in session storage so it
remains scoped to the current browser tab. Restore it on the next page
and use the browser's native scrolling behavior to reveal the active
item when needed.
When the active dropdown is closed, reveal its top-level heading instead
of the hidden child. Persist only positive offsets from an overflowing
sidebar so a collapsed or non-scrollable layout cannot erase a useful
saved position with zero.
Propagate the signal-provided database alias through config context
cache invalidation so scope lookups, cache updates, and commit callbacks
use the same connection and transaction as the triggering change.
Watch Cluster scope changes through `_site_id` and add routing coverage
for direct, nested, tagged, reparented, and upstream invalidation paths.
`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
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.