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)) |