fnp
/
redakcja.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
genre-thema mapping
[redakcja.git]
/
src
/
alerts
/
models.py
diff --git
a/src/alerts/models.py
b/src/alerts/models.py
index
66d1bff
..
a262980
100644
(file)
--- a/
src/alerts/models.py
+++ b/
src/alerts/models.py
@@
-21,7
+21,7
@@
class Alert(models.Model):
cls.objects.filter(book=book).delete()
try:
wlbook = book.wldocument(publishable=False, librarian2=True)
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
cls.objects.create(book=book, tag='parse', comment=str(e))
return
@@
-39,4
+39,5
@@
class Alert(models.Model):
@receiver(post_commit)
def validate_post_commit(sender, **kwargs):
@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)