Ensure CSRF cookie on public views

pull/901/head
Piero Toffanin 2020-08-19 09:13:45 -04:00
rodzic 0e08b0671a
commit 9b11a6aded
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -7,7 +7,7 @@ from django.shortcuts import render
from app.api.tasks import TaskSerializer
from app.models import Task
from django.views.decorators.csrf import ensure_csrf_cookie
def get_public_task(task_pk):
"""
@ -18,6 +18,7 @@ def get_public_task(task_pk):
raise Http404()
return task
@ensure_csrf_cookie
def handle_map(request, template, task_pk=None, hide_title=False):
task = get_public_task(task_pk)
@ -36,6 +37,7 @@ def map(request, task_pk=None):
def map_iframe(request, task_pk=None):
return handle_map(request, 'app/public/map_iframe.html', task_pk, True)
@ensure_csrf_cookie
def handle_model_display(request, template, task_pk=None):
task = get_public_task(task_pk)