+# This file is part of FNP-Redakcja, licensed under GNU Affero GPLv3 or later.
+# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
+#
import os
import functools
import logging
logger = logging.getLogger("fnp.wiki_img")
-from django.core.urlresolvers import reverse
+from django.urls import reverse
from wiki.helpers import (JSONResponse, JSONFormInvalid, JSONServerError,
ajax_require_permission)
if request.method == 'POST':
form = ImageSaveForm(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
"author": change.author_str(),
"date": localize(change.created_at),
"publishable": _("Publishable") + "\n" if change.publishable else "",
- "tag": ',\n'.join(unicode(tag) for tag in change.tags.all()),
+ "tag": ',\n'.join(str(tag) for tag in change.tags.all()),
})
return JSONResponse(changes)
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