summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/views/editor_helpers.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/views/editor_helpers.py b/core/views/editor_helpers.py
index 960d6cf..319abb6 100644
--- a/core/views/editor_helpers.py
+++ b/core/views/editor_helpers.py
@@ -9,6 +9,9 @@ from pathlib import Path
import django.forms as forms
import troggle.settings as settings
+from django.views.decorators.csrf import ensure_csrf_cookie
+from .auth import login_required_if_public
+
from troggle.lib import version_control
MAX_IMAGE_WIDTH = 1000
@@ -36,6 +39,8 @@ def image_selector(request, path):
return render(request, 'image_selector.html', {'thumbnails': thumbnails})
+@login_required_if_public
+@ensure_csrf_cookie
def new_image_form(request, path):
'''Manages a form to upload new images'''
directory = path.rsplit('/', 1)[0]