kopia lustrzana https://github.com/OpenDroneMap/WebODM
Ensure CSRF cookie on public views
rodzic
0e08b0671a
commit
9b11a6aded
|
@ -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)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue