Skip to content

Conversation

@jnovinger
Copy link
Member

Fixes: #20641

The get_view_name() utility function crashed with AttributeError when called on viewsets that override get_queryset() without setting a class-level queryset attribute (e.g., ObjectChangeViewSet).

This pattern became necessary in #20089 to force re-evaluation of valid_models() on each request, ensuring ObjectChange querysets reflect current ContentType state.

Added None check to fall back to DRF's default view naming when no class-level queryset exists.

The get_view_name() utility function crashed with AttributeError when
called on viewsets that override get_queryset() without setting a
class-level queryset attribute (e.g., ObjectChangeViewSet).

This pattern became necessary in #20089 to force re-evaluation of
valid_models() on each request, ensuring ObjectChange querysets reflect
current ContentType state.

Added None check to fall back to DRF's default view naming when no
class-level queryset exists.
@jnovinger jnovinger requested review from a team and arthanson and removed request for a team October 21, 2025 02:45
@arthanson arthanson merged commit fb8d41b into main Oct 23, 2025
10 checks passed
@jeremystretch jeremystretch deleted the 20641-fix-objectchange-browsable-api branch October 23, 2025 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError in ObjectChangeViewSet browsable API: 'NoneType' object has no attribute 'model'

2 participants