diff --git a/scipost/models.py b/scipost/models.py index afd4c5c3c6311087da65966de8657276181190f9..a01cfab06efcbe908ab5b4b089829b57f67ddd1e 100644 --- a/scipost/models.py +++ b/scipost/models.py @@ -290,15 +290,17 @@ class Contributor(models.Model): def expertises_as_ul(self): output = '<ul>' - for exp in self.expertises: - output += '<li>%s</li>' % subject_areas_dict[exp] + if self.expertises: + for exp in self.expertises: + output += '<li>%s</li>' % subject_areas_dict[exp] output += '</ul>' return mark_safe(output) def expertises_as_string(self): output = '' - for exp in self.expertises: - output += subject_areas_dict[exp] + ', ' + if self.expertises: + for exp in self.expertises: + output += subject_areas_dict[exp] + ', ' return output def assignments_summary_as_td(self):