X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/1405761d13e0ba62db4b1f9a9d5fa1472142b6d0..e574992403e4b13920e4912511f5c48b006198ba:/apps/catalogue/models/book.py?ds=sidebyside diff --git a/apps/catalogue/models/book.py b/apps/catalogue/models/book.py index e6f08a91a..c2b54e4c5 100644 --- a/apps/catalogue/models/book.py +++ b/apps/catalogue/models/book.py @@ -275,10 +275,11 @@ class Book(models.Model): obsolete_children = set(b for b in book.children.all() if b not in children) for n, child_book in enumerate(children): + new_child = child_book.parent != book child_book.parent = book child_book.parent_number = n child_book.save() - if cover_changed: + if new_child or cover_changed: child_book.parent_cover_changed() # Disown unfaithful children and let them cope on their own. for child in obsolete_children: