librarian update
[redakcja.git] / apps / catalogue / views.py
index 94710ca..3bee910 100644 (file)
@@ -101,7 +101,7 @@ def create_missing(request, slug=None):
     if request.method == "POST":
         form = forms.DocumentCreateForm(request.POST, request.FILES)
         if form.is_valid():
-            
+
             if request.user.is_authenticated():
                 creator = request.user
             else:
@@ -225,7 +225,7 @@ def book_html(request, slug):
     if not book.accessible(request):
         return HttpResponseForbidden("Not authorized.")
 
-    doc = book.wldocument(parse_dublincore=False)
+    doc = book.wldocument()
     html = doc.as_html()
 
     html = html.get_string() if html is not None else ''
@@ -395,14 +395,14 @@ def chunk_mass_edit(request):
     if request.method == 'POST':
         ids = map(int, filter(lambda i: i.strip() != '', request.POST.get('ids').split(',')))
         chunks = map(lambda i: Chunk.objects.get(id=i), ids)
-        
+
         stage = request.POST.get('stage')
         if stage:
             try:
                 stage = Chunk.tag_model.objects.get(slug=stage)
             except Chunk.DoesNotExist:
                 stage = None
-           
+
             for c in chunks:
                 c.stage = stage
 
@@ -414,7 +414,7 @@ def chunk_mass_edit(request):
                 user = User.objects.get(username=username)
             except User.DoesNotExist, e:
                 user = None
-                
+
             for c in chunks:
                 c.user = user
 
@@ -482,7 +482,8 @@ def publish(request, slug):
         return HttpResponseForbidden("Not authorized.")
 
     try:
-        book.publish(request.user)
+        protocol = 'https://' if request.is_secure() else 'http://'
+        book.publish(request.user, host=protocol + request.get_host())
     except NotAuthorizedError:
         return http.HttpResponseRedirect(reverse('apiclient_oauth'))
     except ApiError, e: