X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/ce8d791a5298e0cb2569034aec4c8b57afac97b2..d7ef322bd562485405be95d8812d4ad79ac458fb:/apps/catalogue/tasks.py diff --git a/apps/catalogue/tasks.py b/apps/catalogue/tasks.py index e9b8cf9b..3e230379 100644 --- a/apps/catalogue/tasks.py +++ b/apps/catalogue/tasks.py @@ -9,3 +9,12 @@ def refresh_by_pk(cls, pk): def refresh_instance(instance): refresh_by_pk.delay(type(instance), instance.pk) + +@task +def publishable_error(book): + try: + book.assert_publishable() + except AssertionError, e: + return e + else: + return None