set birth_date to 1970-01-01 if missing.

because we use it to track underageness.
This commit is contained in:
Andreas Madsack 2018-01-13 14:40:38 +01:00
parent 266c999be3
commit 96ee3032d4

View File

@ -175,6 +175,8 @@ def import_member(member_data):
for key in ['birth_date', 'nick', 'phone_number']: for key in ['birth_date', 'nick', 'phone_number']:
value = member_data.get(f'profile__{key}') value = member_data.get(f'profile__{key}')
if not value and key == 'birth_date':
value = '1970-1-1'
if value: if value:
setattr(member.profile_profile, key, value) setattr(member.profile_profile, key, value)
member.profile_profile.save() member.profile_profile.save()