set popularity when creating a book
authorJan Szejko <janek37@gmail.com>
Tue, 27 Feb 2018 10:06:42 +0000 (11:06 +0100)
committerJan Szejko <janek37@gmail.com>
Tue, 27 Feb 2018 10:06:42 +0000 (11:06 +0100)
src/catalogue/models/book.py

index 8b85ec7..e5ab5e4 100644 (file)
@@ -465,6 +465,7 @@ class Book(models.Model):
             child.parent_cover_changed()
 
         book.save()  # update sort_key_author
             child.parent_cover_changed()
 
         book.save()  # update sort_key_author
+        book.update_popularity()
         cls.published.send(sender=cls, instance=book)
         return book
 
         cls.published.send(sender=cls, instance=book)
         return book