diff --git a/elections2021/models.py b/elections2021/models.py index 5fe4a67a1aff796e7a11fe649129b2484257c712..84db38d26dd4c8f94a6ff95fca796cbcb1365223 100644 --- a/elections2021/models.py +++ b/elections2021/models.py @@ -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