Skip to content

Commit ba432e1

Browse files
committed
skip fields if user is none
1 parent 53ccf88 commit ba432e1

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

partner_programs/admin.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,15 @@ def get_export_file(self, partner_program: PartnerProgram):
7676
response_data = tablib.Dataset(headers=column_names)
7777
for profile in profiles:
7878
if profile.user is None:
79-
continue
80-
row = [
81-
profile.user.first_name,
82-
profile.user.last_name,
83-
profile.user.patronymic,
84-
profile.user.email,
85-
str(profile.user.birthday),
86-
]
79+
row = [""] * 5
80+
else:
81+
row = [
82+
profile.user.first_name,
83+
profile.user.last_name,
84+
profile.user.patronymic,
85+
profile.user.email,
86+
str(profile.user.birthday),
87+
]
8788

8889
json_data = profile.partner_program_data
8990
for key in json_schema:

0 commit comments

Comments
 (0)