404 plutôt que 500 sur profil inexistant
This commit is contained in:
parent
5275e9036a
commit
833a8367cf
1 changed files with 2 additions and 2 deletions
|
@ -54,8 +54,8 @@ class ProfilView(LoginRequiredMixin, DetailView):
|
||||||
# Restriction d'accès pour les archicubes
|
# Restriction d'accès pour les archicubes
|
||||||
if (en_scolarite(self.request.user) or
|
if (en_scolarite(self.request.user) or
|
||||||
self.kwargs.get('username') == self.request.user.username):
|
self.kwargs.get('username') == self.request.user.username):
|
||||||
return Normalien.objects.get(user__username=
|
return get_object_or_404(
|
||||||
self.kwargs.get('username'))
|
Normalien, user__username=self.kwargs.get('username'))
|
||||||
else:
|
else:
|
||||||
raise Http404
|
raise Http404
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue