Cop notes.
[wolnelektury.git] / src / catalogue / templatetags / catalogue_tags.py
index 25976db..1a3e0aa 100644 (file)
@@ -436,6 +436,11 @@ def license_icon(license_url):
     }
 
 
+@register.simple_tag
+def license_locative(license_url, default):
+    return LICENSES.get(license_url, {}).get('locative', default)
+
+
 @register.filter
 def class_name(obj):
     return obj.__class__.__name__
@@ -503,7 +508,7 @@ def content_warning(book):
     warnings_def = {
         'wulgaryzmy': _('vulgar language'),
     }
-    warnings = book.get_extra_info_json().get('content_warnings')
+    warnings = book.get_extra_info_json().get('content_warnings', [])
     warnings = sorted(
         warnings_def.get(w, w)
         for w in warnings