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

Unified Diff: appengine/sheriff_o_matic/alerts_history.py

Issue 1260293009: make version of ts_mon compatible with appengine (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: clean up code Created 5 years, 4 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/sheriff_o_matic/alerts_history.py
diff --git a/appengine/sheriff_o_matic/alerts_history.py b/appengine/sheriff_o_matic/alerts_history.py
index 2d03fa96fd72eec98afa6f1fa986103d34090bcc..6b559a64aedf0a3c14889d03754604fcf337e8f2 100644
--- a/appengine/sheriff_o_matic/alerts_history.py
+++ b/appengine/sheriff_o_matic/alerts_history.py
@@ -4,6 +4,7 @@
from alerts import AlertsHandler
from alerts import AlertsJSON
+from alerts import increment_monarch
from internal_alerts import InternalAlertsHandler
import json
import webapp2
@@ -16,7 +17,6 @@ from google.appengine.ext import ndb
class AlertsHistory(webapp2.RequestHandler):
MAX_LIMIT_PER_PAGE = 100
PUBLIC_TYPE = AlertsHandler.ALERT_TYPE
- PRIVATE_TYPE = InternalAlertsHandler.ALERT_TYPE
def get_entry(self, query, key):
try:
@@ -59,6 +59,7 @@ class AlertsHistory(webapp2.RequestHandler):
}
def get(self, key=None):
+ increment_monarch('alerts-history')
query = AlertsJSON.query().order(-AlertsJSON.date)
result_json = {}
@@ -68,9 +69,6 @@ class AlertsHistory(webapp2.RequestHandler):
# Return only public alerts for non-internal users.
if not user or not user.email().endswith('@google.com'):
query = query.filter(AlertsJSON.type == self.PUBLIC_TYPE)
- else:
- query = query.filter(AlertsJSON.type.IN([self.PUBLIC_TYPE,
- self.PRIVATE_TYPE]))
if key:
result_json.update(self.get_entry(query, key))

Powered by Google App Engine
This is Rietveld 408576698