Skip to content
Snippets Groups Projects
Commit 0d3380f2 authored by jan.bednarik's avatar jan.bednarik
Browse files

elections2021: Redirect on unknown plan or ministry

parent 1c39b1bd
Branches
No related tags found
2 merge requests!269release,!268Volby
...@@ -1172,6 +1172,9 @@ class Elections2021ProgramPage( ...@@ -1172,6 +1172,9 @@ class Elections2021ProgramPage(
@route(r"^plan/([a-z-]+)/$") @route(r"^plan/([a-z-]+)/$")
def plan_detail(self, request, param=None): def plan_detail(self, request, param=None):
plan = param if param in PLAN_OPTIONS else None plan = param if param in PLAN_OPTIONS else None
if not plan:
return HttpResponseRedirect(self.url)
title = None title = None
head_text = "" head_text = ""
head_image = "" head_image = ""
...@@ -1219,6 +1222,9 @@ class Elections2021ProgramPage( ...@@ -1219,6 +1222,9 @@ class Elections2021ProgramPage(
@route(r"^resort/([a-z-]+)/$") @route(r"^resort/([a-z-]+)/$")
def ministry_detail(self, request, param=None): def ministry_detail(self, request, param=None):
ministry = param if param in MINISTRY_OPTIONS else None ministry = param if param in MINISTRY_OPTIONS else None
if not ministry:
return HttpResponseRedirect(self.url)
title = None title = None
head_photo = None head_photo = None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment