X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/d606942f6eb286933eb71f4232db580fcb3a166c..f293bf6e6217d2277d11b65fdb63bc35badc8e68:/apps/catalogue/models.py diff --git a/apps/catalogue/models.py b/apps/catalogue/models.py index f22c9e19e..6470ebb83 100644 --- a/apps/catalogue/models.py +++ b/apps/catalogue/models.py @@ -61,7 +61,6 @@ class Tag(TagBase): category = models.CharField(_('category'), max_length=50, blank=False, null=False, db_index=True, choices=TAG_CATEGORIES) description = models.TextField(_('description'), blank=True) - main_page = models.BooleanField(_('main page'), default=False, db_index=True, help_text=_('Show tag on main page')) user = models.ForeignKey(User, blank=True, null=True) book_count = models.IntegerField(_('book count'), blank=True, null=True) @@ -175,7 +174,11 @@ class Tag(TagBase): try: tag_names = getattr(info, field_name) except: - tag_names = [getattr(info, category)] + try: + tag_names = [getattr(info, category)] + except: + # For instance, Pictures do not have 'genre' field. + continue for tag_name in tag_names: tag_sort_key = tag_name if category == 'author':