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