Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1925)

Unified Diff: appengine/findit/waterfall/flake/flake_analysis_service.py

Issue 2435983003: [Findit] Asynchronously process flake reports from chromium-try-flakes. (Closed)
Patch Set: fix nit. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: appengine/findit/waterfall/flake/flake_analysis_service.py
diff --git a/appengine/findit/waterfall/flake/flake_analysis_service.py b/appengine/findit/waterfall/flake/flake_analysis_service.py
index b1ba62540f50da745f723a1252922e5bca375034..5bf59375eb5ee047b8def11768fb144b630ea2da 100644
--- a/appengine/findit/waterfall/flake/flake_analysis_service.py
+++ b/appengine/findit/waterfall/flake/flake_analysis_service.py
@@ -169,11 +169,11 @@ def _CheckForNewAnalysis(request):
return _MergeNewRequestIntoExistingOne(request, previous_request)
-def _IsAuthorizedUser(user_email):
- """Returns True if the given user email account is authorized for access."""
- return user_email and (
+def IsAuthorizedUser(user_email, is_admin):
+ """Returns True if the given user email account is authorized for access."""
+ return is_admin or (user_email and (
user_email in constants.WHITELISTED_APP_ACCOUNTS or
- user_email.endswith('@google.com'))
+ user_email.endswith('@google.com')))
def ScheduleAnalysisForFlake(request, user_email, is_admin):
@@ -190,7 +190,7 @@ def ScheduleAnalysisForFlake(request, user_email, is_admin):
"""
assert len(request.build_steps) > 0, 'At least 1 build step is needed!'
- if not is_admin and not _IsAuthorizedUser(user_email):
+ if not IsAuthorizedUser(user_email, is_admin):
return None
request.user_emails = [user_email]
« appengine/findit/test/findit_api_test.py ('K') | « appengine/findit/waterfall-backend.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698