Page MenuHomePhabricator

include_invalid overwrites other querysets, returning all objects
Open, HighPublic

Description

We added the invalid application status in [] and utilised a model manager to exclude invalid applications by default (https://github.com/WikipediaLibrary/TWLight/blob/ead6650a36df06385457952b4e256f96dfc0fddd/TWLight/applications/models.py#L38). include_invalid should return all application objects, even those which are invalid, but shouldn't overwrite any other queryset filters.

Unfortunately, with the way the manager was setup, it seems to return _all_ application objects when used from another model, e.g. editor.applications.mode.include_invalid.

See https://github.com/WikipediaLibrary/TWLight/commit/ad4e5a6de14d00c14cbdfd40ef90df6ab015eda2 for a specific fix. We should implement a better broader fix which retains previous/inherent filtering.

Event Timeline

Potential privacy issue.

Hey @Samwalton9 I am interested in working on this, can you explain a little more what we are trying to do here.

See https://github.com/WikipediaLibrary/TWLight/commit/ad4e5a6de14d00c14cbdfd40ef90df6ab015eda2 for a specific fix. We should implement a better broader fix which retains previous/inherent filtering.

unfortunately changes made in this commit are no more in the current version of code.