X-Git-Url: https://git.mdrn.pl/audio.git/blobdiff_plain/d64f05ea901ccb7e61eacd9a5579bb81138b193d..5c11ba52a0f81411f3b3a092e2547e3722a8ee59:/apps/archive/templatetags/tags.py diff --git a/apps/archive/templatetags/tags.py b/apps/archive/templatetags/tags.py index 25389ef..8e208a6 100755 --- a/apps/archive/templatetags/tags.py +++ b/apps/archive/templatetags/tags.py @@ -4,9 +4,18 @@ register = template.Library() @register.inclusion_tag('archive/tags/multiple_tags_table.html') def multiple_tags_table(tags, table=True): - return locals() + new_tags = {} + if tags: + for k, v in tags.items(): + if isinstance(v, list): + new_tags[k] = v + else: + new_tags[k] = [v] + return {"tags": new_tags, "table": table} @register.inclusion_tag('archive/tags/tags_table.html') def tags_table(tags, table=True): + if tags is None: + tags = {} return locals()