From: Jan Szejko Date: Tue, 31 Jan 2017 14:04:19 +0000 (+0100) Subject: filter empty identifiers for curriculum X-Git-Url: https://git.mdrn.pl/edumed.git/commitdiff_plain/d902ba6fd8f909be4f75d300bd0eda98f9ba04ed?ds=sidebyside;hp=fab117d14d967cf27c6e5ea4956316bea5c68edd filter empty identifiers for curriculum --- diff --git a/curriculum/templatetags/curriculum_tags.py b/curriculum/templatetags/curriculum_tags.py index cc37d0e..983ceac 100755 --- a/curriculum/templatetags/curriculum_tags.py +++ b/curriculum/templatetags/curriculum_tags.py @@ -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]