Skip to content
Snippets Groups Projects
Unverified Commit 1009fa0b authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Merge pull request #1726 from OpenTechFund/bug/project-empty-address

Handle empty address on application projects.
parents bce7d8ad 40496908
No related branches found
Tags v2.8.1
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