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
#
return render(request, 'catalogue/my_page.html', {
'last_books': sorted(request.session.get("wiki_last_books", {}).items(),
key=lambda x: x[1]['time'], reverse=True),
+
+ "logout_to": '/',
})
return direct_to_template(request, "catalogue/document_create_missing.html", extra_context={
"slug": slug,
"form": form,
+
+ "logout_to": '/',
})
"ok_list": ok_list,
"skipped_list": skipped_list,
"error_list": error_list,
+
+ "logout_to": '/',
})
else:
form = forms.DocumentsUploadForm()
return direct_to_template(request, "catalogue/document_upload.html", extra_context={
"form": form,
+
+ "logout_to": '/',
})
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,
})
return direct_to_template(request, "catalogue/book_append_to.html", extra_context={
"book": book,
"form": form,
+
+ "logout_to": '/',
})