This deserves its own file, e.g. template_filters.py. Maybe worth refactoring in the future. _Originally posted by @Adman in https://github.com/fmfi-svt/eprihlaska/pull/239#discussion_r1486883104_