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

Unified Diff: appengine/findit/handlers/crash/crash_config.py

Issue 1852383002: [Findit] Integrate with Fracas through Pub/Sub. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Just rebase. Created 4 years, 8 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
« no previous file with comments | « appengine/findit/handlers/crash/__init__.py ('k') | appengine/findit/handlers/crash/fracas_crash.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/handlers/crash/crash_config.py
diff --git a/appengine/findit/handlers/crash/crash_config.py b/appengine/findit/handlers/crash/crash_config.py
new file mode 100644
index 0000000000000000000000000000000000000000..d3ed043f1bf60ce05c3648f53e5cb2087bba5ccd
--- /dev/null
+++ b/appengine/findit/handlers/crash/crash_config.py
@@ -0,0 +1,33 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Handles requests to the crash config page."""
+
+import json
+
+from google.appengine.api import users
+
+from common.base_handler import BaseHandler
+from common.base_handler import Permission
+from model.crash.crash_config import CrashConfig as CrashConfigModel
+
+
+class CrashConfig(BaseHandler):
+ PERMISSION_LEVEL = Permission.ADMIN
+
+ def HandleGet(self):
+ settings = CrashConfigModel.Get()
+
+ data = {
+ 'fracas': settings.fracas,
+ }
+
+ return {'template': 'crash/crash_config.html', 'data': data}
+
+ def HandlePost(self):
+ data = self.request.params.get('data')
+ new_config_dict = json.loads(data)
+ CrashConfigModel.Get().Update(
+ users.get_current_user(), users.IsCurrentUserAdmin(), **new_config_dict)
+ return self.HandleGet()
« no previous file with comments | « appengine/findit/handlers/crash/__init__.py ('k') | appengine/findit/handlers/crash/fracas_crash.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698