X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/8a6efdde5fcb28fb6d82695548a3412829a3e6a2..91a20d3c82e0edcd883148b14df90b56a38ba2b2:/src/alerts/models.py 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)