X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/e977f7187b10b1bc0a30794cd585c6b840568996..25e7ab3df1f48cf819df12c5642df6ccf3c7500e:/src/documents/views.py?ds=sidebyside diff --git a/src/documents/views.py b/src/documents/views.py index 397d78bd..0a9c0982 100644 --- a/src/documents/views.py +++ b/src/documents/views.py @@ -224,7 +224,7 @@ def book_xml(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) @@ -572,16 +572,18 @@ def publish(request, slug): if form.is_valid(): days = form.cleaned_data['days'] beta = form.cleaned_data['beta'] + hidden = form.cleaned_data['hidden'] 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.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: