From: Jan Szejko Date: Wed, 10 Feb 2016 13:02:10 +0000 (+0100) Subject: #8 tagged object list for audiobooks X-Git-Url: https://git.mdrn.pl/wolnelektury.git/commitdiff_plain/04f567d3dcf63ec88484ba25a178c6eb336ea04e?ds=sidebyside #8 tagged object list for audiobooks --- diff --git a/src/catalogue/models/tag.py b/src/catalogue/models/tag.py index 57935f8fb..06aa7a1d5 100644 --- a/src/catalogue/models/tag.py +++ b/src/catalogue/models/tag.py @@ -9,6 +9,7 @@ from django.db import models from django.db.models import permalink from django.dispatch import Signal from django.utils.translation import ugettext_lazy as _ + from newtagging.models import TagBase from ssify import flush_ssi_includes @@ -48,7 +49,9 @@ class Tag(TagBase): after_change = Signal(providing_args=['instance', 'languages']) class UrlDeprecationWarning(DeprecationWarning): - pass + def __init__(self, tags=None): + super(Tag.UrlDeprecationWarning, self).__init__() + self.tags = tags categories_rev = { 'autor': 'author', @@ -189,9 +192,7 @@ class Tag(TagBase): e.ambiguous_slugs = ambiguous_slugs raise e if deprecated: - e = Tag.UrlDeprecationWarning() - e.tags = real_tags - raise e + raise Tag.UrlDeprecationWarning(tags=real_tags) return real_tags else: return TagBase.get_tag_list(tags) diff --git a/src/catalogue/templates/catalogue/inline_tag_list.html b/src/catalogue/templates/catalogue/inline_tag_list.html index 920b55500..cf53e2d73 100755 --- a/src/catalogue/templates/catalogue/inline_tag_list.html +++ b/src/catalogue/templates/catalogue/inline_tag_list.html @@ -1,37 +1,29 @@ {% load i18n %} {% load catalogue_tags %} - {% if choices %} - {% if category_choices %} - - {% endif %} - {% if tags %} + +{% if choices %} + {% if category_choices %} - {% endif %} - {% else %} - {% if tags %} -