Verified Commit 1eb20dbd authored by Jakob Moser's avatar Jakob Moser
Browse files

Fix retrieval code

parent 141ed235
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -8,7 +8,11 @@ type ColiCertification = FachschaftCertification

certification_classes: Mapping[str, type[ColiCertification]] = {
    cls.required_office_kind_name: cls
    for cls in get_args(ColiCertification.__value__)
    # Unnecessary complex hack. We want to get out all the classes which make up the alias "ColiCertification".
    # We first need to access the value of the alias (this is either a union or a single type).
    # If it is a union, then we need get_args to get all the types in the union, otherwise, we just put the
    # single type in a tuple for consistency.
    for cls in get_args(ColiCertification.__value__) or (ColiCertification.__value__, )
}