X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/60c3eb6ecbe5c000aa4d24344e85d2ed00d8983c..a0f6b1a1a9c460b0fd7430581fa7f93d61985230:/src/catalogue/models/book.py diff --git a/src/catalogue/models/book.py b/src/catalogue/models/book.py index 5ac999eeb..c537e5d62 100644 --- a/src/catalogue/models/book.py +++ b/src/catalogue/models/book.py @@ -386,6 +386,7 @@ class Book(models.Model): for child in notify_cover_changed: child.parent_cover_changed() + book.save() # update sort_key_author cls.published.send(sender=cls, instance=book) return book @@ -499,6 +500,13 @@ class Book(models.Model): names = [tag[0] for tag in names] return ', '.join(names) + def publisher(self): + publisher = self.extra_info['publisher'] + if isinstance(publisher, basestring): + return publisher + elif isinstance(publisher, list): + return ', '.join(publisher) + @classmethod def tagged_top_level(cls, tags): """ Returns top-level books tagged with `tags`.