X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/8a6efdde5fcb28fb6d82695548a3412829a3e6a2..07184f3d87ef093639e4eb908cee45cf69c4a0bb:/src/alerts/models.py?ds=sidebyside diff --git a/src/alerts/models.py b/src/alerts/models.py index 132531fd..a262980c 100644 --- a/src/alerts/models.py +++ b/src/alerts/models.py @@ -39,4 +39,5 @@ class Alert(models.Model): @receiver(post_commit) def validate_post_commit(sender, **kwargs): - Alert.validate_book(sender.tree.book) + if hasattr(sender.tree, 'book'): + Alert.validate_book(sender.tree.book)