User list sorted by last activity.
[redakcja.git] / src / documents / views.py
index 397d78b..0a9c098 100644 (file)
@@ -224,7 +224,7 @@ def book_xml(request, slug):
 
 @never_cache
 def book_xml_dc(request, slug):
 
 @never_cache
 def book_xml_dc(request, slug):
-    book = get_object_or_404(Book, dc_slug=slug)
+    book = get_object_or_404(Book, catalogue_book_id=slug)
     return serve_xml(request, book, slug)
 
 
     return serve_xml(request, book, slug)
 
 
@@ -572,16 +572,18 @@ def publish(request, slug):
     if form.is_valid():
         days = form.cleaned_data['days']
         beta = form.cleaned_data['beta']
     if form.is_valid():
         days = form.cleaned_data['days']
         beta = form.cleaned_data['beta']
+        hidden = form.cleaned_data['hidden']
     else:
         days = 0
         beta = False
     else:
         days = 0
         beta = False
+        hidden = False
     book = get_object_or_404(Book, slug=slug)
     if not book.accessible(request):
         return HttpResponseForbidden("Not authorized.")
 
     try:
         protocol = 'https://' if request.is_secure() else 'http://'
     book = get_object_or_404(Book, slug=slug)
     if not book.accessible(request):
         return HttpResponseForbidden("Not authorized.")
 
     try:
         protocol = 'https://' if request.is_secure() else 'http://'
-        book.publish(request.user, host=protocol + request.get_host(), days=days, beta=beta)
+        book.publish(request.user, host=protocol + request.get_host(), days=days, beta=beta, hidden=hidden)
     except NotAuthorizedError:
         return http.HttpResponseRedirect(reverse('apiclient_oauth' if not beta else 'apiclient_beta_oauth'))
     except BaseException as e:
     except NotAuthorizedError:
         return http.HttpResponseRedirect(reverse('apiclient_oauth' if not beta else 'apiclient_beta_oauth'))
     except BaseException as e: