from catalogue import helpers
from catalogue.helpers import active_tab
from catalogue.models import Book, Chunk, BookPublishRecord, ChunkPublishRecord
+from catalogue.tasks import publishable_error
from catalogue import xml_tools
#
form = forms.ReadonlyBookForm(instance=book)
editable = False
-
- try:
- book.assert_publishable()
- except AssertionError, e:
- publishable = False
- publishable_error = e
- else:
- publishable = True
- publishable_error = None
+ task = publishable_error.delay(book)
+ publish_error = task.wait()
+ publishable = publish_error is None
return direct_to_template(request, "catalogue/book_detail.html", extra_context={
"book": book,
"publishable": publishable,
- "publishable_error": publishable_error,
+ "publishable_error": publish_error,
"form": form,
"editable": editable,
})