Skip to content

Use get_queryset functions when using valid_models to force re-evaluation #20089

@arthanson

Description

@arthanson

Proposed Changes

The code currently defines queryset using valid_models as class variables like the following:

class ObjectChangeListView(generic.ObjectListView):
    queryset = ObjectChange.objects.valid_models()

instead define these as get_queryset functions that return ObjectChange.objects.valid_models()

Justification

valid_models creates a set of content types and then returns a filtered list of ObjectTypes. The problem is that when defined as class variables this is only done when the class is instantiated and not when requested, so any potential changes to ContentTypes after instantiation is not picked up.

Metadata

Metadata

Assignees

Labels

complexity: lowRequires minimal effort to implementstatus: acceptedThis issue has been accepted for implementationtype: featureIntroduction of new functionality to the application

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions