From c94354c3ceda2f026611242dae6312c7d759bb5c Mon Sep 17 00:00:00 2001 From: euxzy Date: Sat, 13 Dec 2025 08:57:25 +0700 Subject: [PATCH] Add participant type to test user and simplify enum handling in check-in response --- routes/tests/test_checkin.py | 1 + schemas/checkin.py | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/routes/tests/test_checkin.py b/routes/tests/test_checkin.py index 77e77f8..283f1aa 100644 --- a/routes/tests/test_checkin.py +++ b/routes/tests/test_checkin.py @@ -42,6 +42,7 @@ def setUp(self) -> None: last_name="user", password=generate_hash_password("password"), is_active=True, + participant_type="Student" ) self.db.add(self.test_user) self.db.commit() diff --git a/schemas/checkin.py b/schemas/checkin.py index c2711e0..191a649 100644 --- a/schemas/checkin.py +++ b/schemas/checkin.py @@ -34,10 +34,8 @@ def user_model_to_checkin_response(user: User) -> CheckinUserResponse: tshirt_size = None participant_type = None try: - tshirt_size = TShirtSize(user.t_shirt_size) if user.t_shirt_size else None - participant_type = ( - ParticipantType(user.participant_type) if user.participant_type else None - ) + tshirt_size = user.t_shirt_size + participant_type = user.participant_type except ValueError as e: logger.error(f"Invalid enum value in user model: {e}")