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