filter empty identifiers for curriculum
authorJan Szejko <janek37@gmail.com>
Tue, 31 Jan 2017 14:04:19 +0000 (15:04 +0100)
committerJan Szejko <janek37@gmail.com>
Tue, 31 Jan 2017 14:04:19 +0000 (15:04 +0100)
curriculum/templatetags/curriculum_tags.py

index cc37d0e..983ceac 100755 (executable)
@@ -22,6 +22,8 @@ def competence(texts, level):
 
 @register.inclusion_tag("curriculum/snippets/curriculum.html")
 def curriculum(identifiers):
+    # shouldn't be needed, but is
+    identifiers = [id for id in identifiers if id]
     try:
         currs = [Curriculum.objects.get(identifier__iexact=identifier.replace(' ', ''))
                  for identifier in identifiers]