Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions backend/usecase/registration_usecase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down