mirror of
https://github.com/DMOJ/online-judge.git
synced 2024-11-25 16:32:37 +08:00
Return 404 for non-existent users
This commit is contained in:
parent
886fd42600
commit
e381e1f9b8
@ -81,7 +81,7 @@ class UserPage(TitleMixin, UserMixin, DetailView):
|
|||||||
return super(UserPage, self).dispatch(request, *args, **kwargs)
|
return super(UserPage, self).dispatch(request, *args, **kwargs)
|
||||||
except Http404:
|
except Http404:
|
||||||
return generic_message(request, _('No such user'), _('No user handle "%s".') %
|
return generic_message(request, _('No such user'), _('No user handle "%s".') %
|
||||||
self.kwargs.get(self.slug_url_kwarg, None))
|
self.kwargs.get(self.slug_url_kwarg, None), status=404)
|
||||||
|
|
||||||
def get_title(self):
|
def get_title(self):
|
||||||
return (_('My account') if self.request.user == self.object.user else
|
return (_('My account') if self.request.user == self.object.user else
|
||||||
|
Loading…
Reference in New Issue
Block a user