Skip to content

Commit

Permalink
fix: replace full_name with first_name and last_name in participants …
Browse files Browse the repository at this point in the history
…excel export
  • Loading branch information
AmooHashem committed Dec 28, 2024
1 parent 2061ee9 commit 797bb31
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions apps/report/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def _get_participants_excel_file(form_id):
# Define headers
headers = [
"ID",
"Full Name",
"First Name",
"Last Name",
"Username",
"Phone Number",
"National Code",
Expand All @@ -37,17 +38,18 @@ def _get_participants_excel_file(form_id):
data = []
for receipt in receipts:
user = receipt.user
school = user.school_studentship.school if user.school_studentship else None
school = user.school_studentship.school

data.append({
"ID": receipt.id,
"Full Name": user.full_name,
"First Name": user.first_name,
"Lastname Name": user.last_name,
"Username": user.username,
"Phone Number": user.phone_number,
"National Code": user.national_code,
"School Name": school.name if school else "",
"City": school.city if school else "",
"Province": school.province if school else "",
"School Name": school.name,
"City": school.city,
"Province": school.province,
"Receipt Status": receipt.status,
"Is Participating": "Yes" if receipt.is_participating else "No",
})
Expand Down

0 comments on commit 797bb31

Please sign in to comment.