404 plutôt que 500 sur profil inexistant

This commit is contained in:
Evarin 2019-01-07 22:11:51 +01:00
parent 5275e9036a
commit 833a8367cf

View file

@ -54,8 +54,8 @@ class ProfilView(LoginRequiredMixin, DetailView):
# Restriction d'accès pour les archicubes
if (en_scolarite(self.request.user) or
self.kwargs.get('username') == self.request.user.username):
return Normalien.objects.get(user__username=
self.kwargs.get('username'))
return get_object_or_404(
Normalien, user__username=self.kwargs.get('username'))
else:
raise Http404