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
No related branches found
No related tags found
2 merge requests!269release,!268Volby
......@@ -1172,6 +1172,9 @@ class Elections2021ProgramPage(
@route(r"^plan/([a-z-]+)/$")
def plan_detail(self, request, param=None):
plan = param if param in PLAN_OPTIONS else None
if not plan:
return HttpResponseRedirect(self.url)
title = None
head_text = ""
head_image = ""
......@@ -1219,6 +1222,9 @@ class Elections2021ProgramPage(
@route(r"^resort/([a-z-]+)/$")
def ministry_detail(self, request, param=None):
ministry = param if param in MINISTRY_OPTIONS else None
if not ministry:
return HttpResponseRedirect(self.url)
title = 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