X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/a494a95bf89ed6aa55b5f14b71a343e33d55bd60..ff573698a8b017b1a70fafbfda44452b2c8d78c1:/apps/catalogue/models/book.py diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index 772634c6..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()