diff options
author | Lars Wirzenius <lwirzenius@wikimedia.org> | 2019-07-22 21:04:20 +0300 |
---|---|---|
committer | Lars Wirzenius <lwirzenius@wikimedia.org> | 2019-07-22 21:04:20 +0300 |
commit | ce84b2ddae06871d9267be28045ac55bbb54ab03 (patch) | |
tree | a478a4467307268f34cb5318adc4b4e17f8a380b /api.py | |
parent | 30f4fbffd8a818817ffa72a67e825198b6a9802f (diff) | |
download | wmf-ci-arch-ce84b2ddae06871d9267be28045ac55bbb54ab03.tar.gz |
Change: return instead of raising
Diffstat (limited to 'api.py')
-rwxr-xr-x | api.py | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -130,9 +130,7 @@ class AccessCheckerPlugin: logging.debug('authz_needed: %r', authz_needed) if authz_needed: logging.debug('checking if access is allowed: %r', scopes) - x = self._checker.access_is_allowed(r.headers, scopes) - logging.debug('x: %r', x) - if not x: + if not self._checker.access_is_allowed(r.headers, scopes): logging.error('Request denied %s %s', r.method, r.path) return bottle.HTTPError(400) @@ -144,7 +142,7 @@ class AccessCheckerPlugin: logging.error( 'Could not handle request: %s %s: %s', r.method, r.path, str(e)) - raise bottle.HTTPError(500) + return bottle.HTTPError(500) return access_checker_wrapper |