X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/8a6efdde5fcb28fb6d82695548a3412829a3e6a2..3957e054be29921a1ace348bdebdcb805a1f89ff:/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)