From 96ee3032d492ddb7edeaa0b6b76d0b9eea573df0 Mon Sep 17 00:00:00 2001 From: Andreas Madsack Date: Sat, 13 Jan 2018 14:40:38 +0100 Subject: [PATCH] set birth_date to 1970-01-01 if missing. because we use it to track underageness. --- byro_shackspace/management/commands/import_shackbureau.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/byro_shackspace/management/commands/import_shackbureau.py b/byro_shackspace/management/commands/import_shackbureau.py index 2b29d54..a2ccc8f 100644 --- a/byro_shackspace/management/commands/import_shackbureau.py +++ b/byro_shackspace/management/commands/import_shackbureau.py @@ -175,6 +175,8 @@ def import_member(member_data): for key in ['birth_date', 'nick', 'phone_number']: value = member_data.get(f'profile__{key}') + if not value and key == 'birth_date': + value = '1970-1-1' if value: setattr(member.profile_profile, key, value) member.profile_profile.save()