X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/c4599df2f08c95fd317967746a3325c3b168acdd..3e276f49505e607b72892b40d18ac2cef194497e:/apps/catalogue/models/book.py?ds=inline diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index df1ff4e0..7e6cbfa2 100755 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -200,10 +200,10 @@ class Book(models.Model): self.gallery = gm.merge() # and move the gallery starts - num_files = gm.dest_size - for chunk in self[len(self) - len_other:]: - chunk.gallery_start += gm.dest_size - gm.num_deleted - chunk.save() + if gm.was_merged: + for chunk in self[len(self) - len_other:]: + chunk.gallery_start += gm.dest_size - gm.num_deleted + chunk.save() other.delete()