Chromium Code Reviews| Index: appengine/findit/common/base_handler.py |
| diff --git a/appengine/findit/common/base_handler.py b/appengine/findit/common/base_handler.py |
| index d4ef7e04b845479c98e074be47e14d0fda4375ff..2581b08dc99d803a1d7ab22f87ca6b11652478b8 100644 |
| --- a/appengine/findit/common/base_handler.py |
| +++ b/appengine/findit/common/base_handler.py |
| @@ -58,7 +58,13 @@ class BaseHandler(webapp2.RequestHandler): |
| """Returns True if the user logged in with corp account or as admin.""" |
| user_email = auth_util.GetUserEmail() |
| return ((user_email and user_email.endswith('@google.com')) or |
| - auth_util.IsCurrentUserAdmin()) |
| + auth_util.IsCurrentUserAdmin()) |
| + |
| + def _ShowDebugInfo(self): # pragma: no cover |
|
chanli
2016/10/15 01:47:21
Do you mind adding a test for this function? Altho
lijeffrey
2016/10/15 02:16:41
Done.
|
| + # Show debug info only if the app is run locally during development, if the |
| + # currently logged-in user is an admin, or if it is explicitly requested |
| + # with parameter 'debug=1'. |
| + return users.is_current_user_admin() or self.request.get('debug') == '1' |
| @staticmethod |
| def CreateError(error_message, return_code=500): |