From 76977b95f95ee19d215bdc49828326b92cddca91 Mon Sep 17 00:00:00 2001 From: ASPactores Date: Fri, 10 Oct 2025 21:48:58 +0800 Subject: [PATCH] fix(registration): reorder CSV export headers to prioritize first and last names --- backend/usecase/registration_usecase.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/backend/usecase/registration_usecase.py b/backend/usecase/registration_usecase.py index 2749c03..cf7abbc 100644 --- a/backend/usecase/registration_usecase.py +++ b/backend/usecase/registration_usecase.py @@ -402,14 +402,19 @@ def get_registration_csv(self, event_id: str) -> FileDownloadOut: writer = csv.writer(temp) # Get headers from Registration DynamoDB model attributes - headers = [ + all_headers = [ attr_name for attr_name in dir(Registration) if not attr_name.startswith('_') and not callable(getattr(Registration, attr_name)) and attr_name not in ['Meta', 'DoesNotExist', 'registrationIdGSI', 'emailLSI'] ] - headers.sort() + + priority_headers = ['firstName', 'lastName'] + remaining_headers = [h for h in all_headers if h not in priority_headers] + remaining_headers.sort() + + headers = priority_headers + remaining_headers logger.info(f'Headers for CSV export: {headers}') writer.writerow(headers)