Skip to content

Commit 76d5d5a

Browse files
authored
Merge pull request #202 from PROCOLLAB-github/hotfix/profile_export
profile.user is None validation
2 parents be22739 + ba432e1 commit 76d5d5a

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

partner_programs/admin.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,16 @@ def get_export_file(self, partner_program: PartnerProgram):
7575

7676
response_data = tablib.Dataset(headers=column_names)
7777
for profile in profiles:
78-
row = [
79-
profile.user.first_name,
80-
profile.user.last_name,
81-
profile.user.patronymic,
82-
profile.user.email,
83-
str(profile.user.birthday),
84-
]
78+
if profile.user is None:
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+
]
8588

8689
json_data = profile.partner_program_data
8790
for key in json_schema:

0 commit comments

Comments
 (0)