Skip to content

Commit

Permalink
handle unknown consultant to raise proper 404 error for users who are
Browse files Browse the repository at this point in the history
playing with URLs...
  • Loading branch information
digitalfox committed Nov 19, 2024
1 parent 256039c commit 53acb2d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion people/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ def consultant_home_by_id(request, consultant_id):

def consultant_home(request, consultant_trigramme):
"""Home page of consultant - this page loads all others mission sub-pages"""
return _consultant_home(request, Consultant.objects.get(trigramme__iexact=consultant_trigramme))
try:
consultant = Consultant.objects.get(trigramme__iexact=consultant_trigramme)
return _consultant_home(request, consultant)
except Consultant.DoesNotExist:
raise Http404


@pydici_non_public
Expand Down

0 comments on commit 53acb2d

Please sign in to comment.