handle unknown camp url slugs with debugmode off
This commit is contained in:
parent
5452da1ddb
commit
69e222247b
|
@ -10,8 +10,12 @@ def camp(request):
|
||||||
queryset containing all camps (used to build the menu and such)
|
queryset containing all camps (used to build the menu and such)
|
||||||
"""
|
"""
|
||||||
if 'camp_slug' in request.resolver_match.kwargs:
|
if 'camp_slug' in request.resolver_match.kwargs:
|
||||||
|
try:
|
||||||
camp = Camp.objects.get(slug=request.resolver_match.kwargs['camp_slug'])
|
camp = Camp.objects.get(slug=request.resolver_match.kwargs['camp_slug'])
|
||||||
request.session['campslug'] = camp.slug
|
request.session['campslug'] = camp.slug
|
||||||
|
except Camp.DoesNotExist:
|
||||||
|
request.session['campslug'] = None
|
||||||
|
camp = None
|
||||||
else:
|
else:
|
||||||
request.session['campslug'] = None
|
request.session['campslug'] = None
|
||||||
camp = None
|
camp = None
|
||||||
|
|
Loading…
Reference in a new issue