# HG changeset patch # User Marcin Kuzminski # Date 2011-10-24 21:07:06 # Node ID 7cd8fd4d1e38949de24511a236f208f3d18d8e34 # Parent 9dae92a65e40242752936e84fb06971b0af04443 #286 raise HttpForbidden if username lookup failed instead of internal server error diff --git a/rhodecode/lib/middleware/simplegit.py b/rhodecode/lib/middleware/simplegit.py --- a/rhodecode/lib/middleware/simplegit.py +++ b/rhodecode/lib/middleware/simplegit.py @@ -167,6 +167,8 @@ class SimpleGit(object): username = REMOTE_USER(environ) try: user = self.__get_user(username) + if user is None: + return HTTPForbidden()(environ, start_response) username = user.username except: log.error(traceback.format_exc()) diff --git a/rhodecode/lib/middleware/simplehg.py b/rhodecode/lib/middleware/simplehg.py --- a/rhodecode/lib/middleware/simplehg.py +++ b/rhodecode/lib/middleware/simplehg.py @@ -133,6 +133,8 @@ class SimpleHg(object): username = REMOTE_USER(environ) try: user = self.__get_user(username) + if user is None: + return HTTPForbidden()(environ, start_response) username = user.username except: log.error(traceback.format_exc())