Put empty strings instead of None as default values

This commit is contained in:
Yohann D'ANELLO 2021-11-14 16:16:17 +01:00
parent 145806b5ce
commit 09c61091d5
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 6 additions and 6 deletions

View File

@ -59,12 +59,12 @@ class User(AbstractUser):
data : dict
Dictionary with user data to update.
"""
self.email = data['email']
self.first_name = data['first_name']
self.last_name = data['last_name']
self.phone_number = data['profile']['phone_number']
self.address = data['profile']['address']
self.comment = data['profile']['section']
self.email = data['email'] or ''
self.first_name = data['first_name'] or ''
self.last_name = data['last_name'] or ''
self.phone_number = data['profile']['phone_number'] or ''
self.address = data['profile']['address'] or ''
self.comment = data['profile']['section'] or ''
for membership_dict in data['memberships']:
if membership_dict['club'] != 22: # Med