valid_about = self.correct_about()
assert bi.about == valid_about, _("rdf:about is not") + " " + valid_about
+ def publishable_error(self):
+ try:
+ return self.assert_publishable()
+ except AssertionError, e:
+ return e
+ else:
+ return None
+
def hidden(self):
return self.slug.startswith('.')
_refresh_by_pk.delay(type(instance), instance.pk, translation.get_language())
-@task
-def _publishable_error(book, language=None):
- prev_language = translation.get_language()
- language and translation.activate(language)
- try:
- return book.assert_publishable()
- except AssertionError, e:
- return e
- else:
- return None
- finally:
- translation.activate(prev_language)
-
-def publishable_error(book):
- return _publishable_error.delay(book,
- translation.get_language()).wait()
-
-
@task(ignore_result=True)
def book_content_updated(book):
book.refresh_dc_cache()
from catalogue import helpers
from catalogue.helpers import active_tab
from catalogue.models import Book, Chunk, BookPublishRecord, ChunkPublishRecord
-from catalogue.tasks import publishable_error
#
# Quick hack around caching problems, TODO: use ETags
form = forms.ReadonlyBookForm(instance=book)
editable = False
- publish_error = publishable_error(book)
+ publish_error = book.publishable_error()
publishable = publish_error is None
return direct_to_template(request, "catalogue/book_detail.html", extra_context={
-Subproject commit cbe81ee35b07783b4f52c3d3dda83db7aaf82d34
+Subproject commit fb1bbfe622abeaaea2a2dfc459d8b779b2d369a2