Page MenuHomePhabricator

Add 'invalid' application status option
Closed, ResolvedPublic

Description

We occasionally have applications which need closing in a way which removes them from statistics and doesn't imply that the application was denied (i.e. 'not approved'). One such case is duplicate applications.

While administrators can remove applications through the admin interface, it's not an elegant option and can lead to other things breaking.

As part of this, any applications with 'invalid' status should not be included in metrics numbers/graphs/charts, and should not be listed on the Review pages.

  • Add Invalid choice to the applications model status field
  • Update Application queryset filters to exclude Invalid applications where appropriate
  • Ensure that tests pass as expected

Event Timeline

Samwalton9-WMF moved this task from Incoming tasks to Done on the Library-Card-Platform board.

There is a PR open for this on the github repo

Thanks @Arcayn, I'm going to take a look shortly!

Done in https://github.com/WikipediaLibrary/TWLight/pull/191 but needs a little work. It turns out that overriding the model manager makes filtering work in unexpected ways. The 'get all applications' behaviour in the model overwrites filtering when you come from another object, e.g. editor.applications.include_invalid returns all applications instead of just those associated with the editor. We should add some checks and tests to avoid returning all applications when we don't mean to.