bugfix
[redakcja.git] / src / documents / views.py
index 225ad55..0fbb3b9 100644 (file)
@@ -362,14 +362,21 @@ def book(request, slug):
     publish_error = book.publishable_error()
     publishable = publish_error is None
 
     publish_error = book.publishable_error()
     publishable = publish_error is None
 
+    stats = None
     try:
     try:
-        doc = book.wldocument()
+        doc = book.wldocument(librarian2=True)
     except:
         doc = None
     except:
         doc = None
-    
+    else:
+        try:
+            stats = doc.get_statistic()
+        except:
+            pass
+
     return render(request, "documents/book_detail.html", {
         "book": book,
         "doc": doc,
     return render(request, "documents/book_detail.html", {
         "book": book,
         "doc": doc,
+        "stats": stats,
         "publishable": publishable,
         "publishable_error": publish_error,
         "form": form,
         "publishable": publishable,
         "publishable_error": publish_error,
         "form": form,