From 17ab59cfb4c9af1c200b7e0a6289fa0a725b56b9 Mon Sep 17 00:00:00 2001
From: "J.-S. Caux" <J.S.Caux@uva.nl>
Date: Wed, 25 Jan 2017 09:19:59 +0100
Subject: [PATCH] Fix bug if expertises is None

---
 scipost/models.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/scipost/models.py b/scipost/models.py
index afd4c5c3c..a01cfab06 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):
-- 
GitLab