Skip to content

Conversation

@jnovinger
Copy link
Member

Fixes: #19520

It turned out that the .prefetch_related('scope') on the PrefixViewSet.queryset attribute was causing scope to not be set on the prefix instance being changed--even though scope_id was set--causing the check in CachedScopeMixin.clean() to fail. I only found this when comparing the behavior of API endpoints for other models that make use of the CachedScopeMixin model mixin.

It turned out that the `.prefetch_related('scope')` on the
`PrefixViewSet.queryset` attribute was causing `scope` to not be set on
the prefix instance being changed, even though `scope_id` _was_ set. I
only found this when comparing the behavior of API endpoints for other
models that make use of the `CachedScopeMixin` model mixin.
@jnovinger jnovinger requested review from a team and arthanson and removed request for a team May 27, 2025 16:11
@arthanson arthanson merged commit cc099e8 into main May 27, 2025
10 checks passed
@jeremystretch jeremystretch deleted the 19520-change-prefix-scope-via-api branch May 28, 2025 12:16
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to change prefix scope via api

3 participants