From 3b9004e2d6e78626017d4a248890bb97ee0178b9 Mon Sep 17 00:00:00 2001 From: Mads Nylund Date: Wed, 25 Sep 2024 14:29:04 +0200 Subject: [PATCH] format --- app/common/enums.py | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/app/common/enums.py b/app/common/enums.py index 01c61e2a..68afaa78 100644 --- a/app/common/enums.py +++ b/app/common/enums.py @@ -31,22 +31,19 @@ def get_user_class_number(user_class: NativeUserClass) -> int: return int(_class.split(".")[0]) -def get_user_class_name(user_class: int) -> NativeUserClass: - match user_class: - case 1: - return NativeUserClass.FIRST - case 2: - return NativeUserClass.SECOND - case 3: - return NativeUserClass.THIRD - case 4: - return NativeUserClass.FOURTH - case 5: - return NativeUserClass.FIFTH - case 6: - return NativeUserClass.ALUMNI - case _: - raise ValueError("Invalid user class") +def get_user_class_name(user_class: int): + if user_class == 1: + return NativeUserClass.FIRST + elif user_class == 2: + return NativeUserClass.SECOND + elif user_class == 3: + return NativeUserClass.THIRD + elif user_class == 4: + return NativeUserClass.FOURTH + elif user_class == 5: + return NativeUserClass.FIFTH + else: + return NativeUserClass.ALUMNI # This can't be removed because it is used in the migrations. It is not used in the code