Skip to content

Commit fb386c8

Browse files
committed
fix(registration): reorder CSV export headers to prioritize first and last names
1 parent 245220b commit fb386c8

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

backend/usecase/registration_usecase.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,14 +402,19 @@ def get_registration_csv(self, event_id: str) -> FileDownloadOut:
402402
writer = csv.writer(temp)
403403

404404
# Get headers from Registration DynamoDB model attributes
405-
headers = [
405+
all_headers = [
406406
attr_name
407407
for attr_name in dir(Registration)
408408
if not attr_name.startswith('_')
409409
and not callable(getattr(Registration, attr_name))
410410
and attr_name not in ['Meta', 'DoesNotExist', 'registrationIdGSI', 'emailLSI']
411411
]
412-
headers.sort()
412+
413+
priority_headers = ['firstName', 'lastName']
414+
remaining_headers = [h for h in all_headers if h not in priority_headers]
415+
remaining_headers.sort()
416+
417+
headers = priority_headers + remaining_headers
413418
logger.info(f'Headers for CSV export: {headers}')
414419
writer.writerow(headers)
415420

0 commit comments

Comments
 (0)