diff --git a/sounds/templatetags/bst_category.py b/sounds/templatetags/bst_category.py index cdefa2847..dc68a532b 100644 --- a/sounds/templatetags/bst_category.py +++ b/sounds/templatetags/bst_category.py @@ -10,6 +10,8 @@ def bst_taxonomy_category_key_to_category_names(category_key): This includes both the top level and the sub level category names. E.g.: "m-sp" -> ("Music", "Solo percussion"), "m" -> ("Music", None) """ + if category_key is None: + return (None, None) if '-' in category_key: # Sub level category key top_level_key = category_key.split('-')[0] diff --git a/templates/molecules/bst_category_form_field.html b/templates/molecules/bst_category_form_field.html index 93353e96d..12c6d2d19 100644 --- a/templates/molecules/bst_category_form_field.html +++ b/templates/molecules/bst_category_form_field.html @@ -26,7 +26,7 @@
{% for value, label in form.fields.bst_category.choices %} {% if "-" in value %} -