X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/040285e94b385dd57a003a4fe5b693c299fe921b..1c79a789f6b773c80bb203e93848ad159b779860:/src/wiki/views.py?ds=sidebyside diff --git a/src/wiki/views.py b/src/wiki/views.py index 332f28fb..17f7b73c 100644 --- a/src/wiki/views.py +++ b/src/wiki/views.py @@ -1,4 +1,6 @@ -# -*- coding: utf-8 -*- +# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# from datetime import datetime import os import logging @@ -6,7 +8,7 @@ from time import mktime from urllib.parse import quote from django.conf import settings -from django.core.urlresolvers import reverse +from django.urls import reverse from django import http from django.http import Http404, HttpResponseForbidden from django.middleware.gzip import GZipMiddleware @@ -115,7 +117,7 @@ def text(request, chunk_id): if request.method == 'POST': form = forms.DocumentTextSaveForm(request.POST, user=request.user, prefix="textsave") if form.is_valid(): - if request.user.is_authenticated(): + if request.user.is_authenticated: author = request.user else: author = None @@ -180,7 +182,7 @@ def revert(request, chunk_id): comment = form.cleaned_data['comment'] comment += "\n#revert to %s" % revision - if request.user.is_authenticated(): + if request.user.is_authenticated: author = request.user else: author = None @@ -222,7 +224,7 @@ def gallery(request, directory): books = Book.objects.filter(gallery=directory) - if not all(book.public for book in books) and not request.user.is_authenticated(): + if not all(book.public for book in books) and not request.user.is_authenticated: return HttpResponseForbidden("Not authorized.") return JSONResponse(images)