svthalia / concrexit

Thalia Website built on Django.
https://thalia.nu
Other
23 stars 11 forks source link

Add and use CaseInsensitiveFilter for promotion admin assignment filter #3652

Closed ColonelPhantom closed 2 months ago

ColonelPhantom commented 3 months ago

Closes #3085.

Summary

Adds a CaseInsensitiveFilter inside the promo admin, and uses it for assigned_to.

Maybe this should be in some more central directory, so we can reuse it more widely? I don't know if we want this in other places too. The code is also a bit messy, but it seems pretty much all of it is needed and Django offers no easier way, sadly.

I also used in-Python code for managing the lower-casing, since I think doing it directly would require Postgres or something and we don't want to break SQLite.

How to test

  1. Go to promo admin
  2. Assign some requests to different capitalizations of the same name (e.g. one to quinten and the other to Quinten)
  3. Observe that these are merged together in one filter option
DeD1rk commented 2 months ago

Nice job getting the facets in there as well :)