X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/5011de9904ee1bd633028b29e3cf6db1cce373a6..267af854023b396c34cdc2b6ff162dc4a40fb61c:/forum/views/users.py diff --git a/forum/views/users.py b/forum/views/users.py index 6eb9baa..3b863da 100644 --- a/forum/views/users.py +++ b/forum/views/users.py @@ -261,7 +261,10 @@ def user_view(template, tab_name, tab_title, tab_description, private=False, tab user = get_object_or_404(User, id=id) # ...or by slug if the slug has been given elif slug is not None: - user = get_object_or_404(User, username=slug) + try: + user = User.objects.get(username__iexact=slug) + except User.DoesNotExist: + raise Http404 if private and not (user == request.user or request.user.is_superuser): raise ReturnImediatelyException(HttpResponseUnauthorized(request))