Skip to content
Snippets Groups Projects
Commit 5990d90b authored by Benjamin Hättasch's avatar Benjamin Hättasch Committed by Nadja Geisler
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 4f933434
No related branches found
No related tags found
No related merge requests found
...@@ -311,6 +311,8 @@ class AKOwnerSelectDispatchView(EventSlugMixin, View): ...@@ -311,6 +311,8 @@ class AKOwnerSelectDispatchView(EventSlugMixin, View):
""" """
def post(self, request, *args, **kwargs): 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"] owner_id = request.POST["owner_id"]
if owner_id == "-1": if owner_id == "-1":
...@@ -345,6 +347,8 @@ class AKOwnerEditDispatchView(EventSlugMixin, View): ...@@ -345,6 +347,8 @@ class AKOwnerEditDispatchView(EventSlugMixin, View):
""" """
def post(self, request, *args, **kwargs): 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"] owner_id = request.POST["owner_id"]
if owner_id == "-1": if owner_id == "-1":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment