Skip to content
Snippets Groups Projects
Commit 40496908 authored by Fredrik Jonsson's avatar Fredrik Jonsson
Browse files

Handle empty address on application projects.

parent bce7d8ad
No related branches found
No related tags found
No related merge requests found
......@@ -393,12 +393,16 @@ class Project(BaseStreamForm, AccessFormData, models.Model):
return self.get_status_display()
def get_address_display(self):
address = json.loads(self.contact_address)
return ', '.join(
address.get(field)
for field in ADDRESS_FIELDS_ORDER
if address.get(field)
)
try:
address = json.loads(self.contact_address)
except json.JSONDecodeError:
return ''
else:
return ', '.join(
address.get(field)
for field in ADDRESS_FIELDS_ORDER
if address.get(field)
)
@classmethod
def create_from_submission(cls, submission):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment