From b3ecd1e950422fb08287548556e10bafb036e639 Mon Sep 17 00:00:00 2001 From: Pinar Alper Date: Wed, 17 Jun 2020 17:13:25 +0200 Subject: [PATCH] null check added- fixes 185 --- core/models/contract.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/models/contract.py b/core/models/contract.py index 2e010c2b..c3cfffa0 100644 --- a/core/models/contract.py +++ b/core/models/contract.py @@ -140,7 +140,7 @@ def to_dict(self): 'project': self.project, 'local_custodians': contact_dicts, 'OTHER_DATA': 'See models/contract.py' - # TODO: Some fields are missing, this might need to be continuted + # TODO: Some fields are missing, this might need to be continued } return base_dict @@ -150,7 +150,9 @@ def serialize_to_export(self): d = self.to_dict() local_custodians = map(lambda v: f"[{v['first_name']} {v['last_name']}, {v['email']}]", d['local_custodians']) + d['local_custodians'] = ','.join(local_custodians) - d['project'] = d['project'].title + if 'project' in d and d['project']: + d['project'] = d['project'].title return d