X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/30cd6983d7c3ce7a593d3f3c09560679ce1d3f26..c86747032e5ea441ee41040559766151e1b3873d:/apps/catalogue/models/book.py?ds=sidebyside diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index 25b9304e..4d1b12e4 100755 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -205,7 +205,8 @@ class Book(models.Model): # and move the gallery starts if gm.was_merged: for chunk in self[len(self) - len_other:]: - chunk.gallery_start += gm.dest_size - gm.num_deleted + old_start = chunk.gallery_start or 1 + chunk.gallery_start = old_start + gm.dest_size - gm.num_deleted chunk.save() other.delete() @@ -270,6 +271,14 @@ class Book(models.Model): valid_about = self.correct_about() assert bi.about == valid_about, _("rdf:about is not") + " " + valid_about + def publishable_error(self): + try: + return self.assert_publishable() + except AssertionError, e: + return e + else: + return None + def hidden(self): return self.slug.startswith('.')