Skip to content
Snippets Groups Projects
Commit 70589016 authored by Benjamin Hättasch's avatar Benjamin Hättasch
Browse files

Check existence of POST argument

Improve robustness of views against malformed/forged requests by checking whether the owner_id POST attribute is set before accessing it.
This fixes #187
parent 3a18dcd1
Branches bugfixes
No related tags found
No related merge requests found
......@@ -311,6 +311,8 @@ class AKOwnerSelectDispatchView(EventSlugMixin, View):
"""
def post(self, request, *args, **kwargs):
if "owner_id" not in request.POST:
return redirect('submit:submission_overview', event_slug=kwargs['event_slug'])
owner_id = request.POST["owner_id"]
if owner_id == "-1":
......@@ -345,6 +347,8 @@ class AKOwnerEditDispatchView(EventSlugMixin, View):
"""
def post(self, request, *args, **kwargs):
if "owner_id" not in request.POST:
return redirect('submit:submission_overview', event_slug=kwargs['event_slug'])
owner_id = request.POST["owner_id"]
if owner_id == "-1":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment