user = get_object_or_404(User, id=id)\r
# ...or by slug if the slug has been given\r
elif slug is not None:\r
- user = get_object_or_404(User, username=slug)\r
+ try:\r
+ user = User.objects.get(username__iexact=slug)\r
+ except User.DoesNotExist:\r
+ raise Http404\r
\r
if private and not (user == request.user or request.user.is_superuser):\r
raise ReturnImediatelyException(HttpResponseUnauthorized(request))\r