cls.objects.filter(book=book).delete()
try:
wlbook = book.wldocument(publishable=False, librarian2=True)
- except Exception:
+ except Exception as e:
cls.objects.create(book=book, tag='parse', comment=str(e))
return
@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)