Open madwort opened 3 months ago
I think I've fought this a bit in the past (having to keep in mind whether a path contains a group name or not) - would be great to have it really obvious (& enforced by the type system).
One idea I wanted to try here was have the types enforced/converted in our django urls.py patterns, so that the views got typed instances of UrlPath/GroupPath, rather than strings.
You can do this with custom url type converters easily enough: https://docs.djangoproject.com/en/5.0/topics/http/urls/#registering-custom-path-converters
https://github.com/opensafely-core/airlock/pull/621#discussion_r1718240397