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

Side by Side Diff: appengine/findit/handlers/crash/crash_config.py

Issue 2356673002: [Findit] Add cracas config in config page. (Closed)
Patch Set: Rebase. Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | appengine/findit/model/crash/crash_config.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Handles requests to the crash config page.""" 5 """Handles requests to the crash config page."""
6 6
7 import json 7 import json
8 8
9 from google.appengine.api import users 9 from google.appengine.api import users
10 10
11 from common.base_handler import BaseHandler 11 from common.base_handler import BaseHandler
12 from common.base_handler import Permission 12 from common.base_handler import Permission
13 from model.crash.crash_config import CrashConfig as CrashConfigModel 13 from model.crash.crash_config import CrashConfig as CrashConfigModel
14 14
15 15
16 class CrashConfig(BaseHandler): 16 class CrashConfig(BaseHandler):
17 PERMISSION_LEVEL = Permission.ADMIN 17 PERMISSION_LEVEL = Permission.ADMIN
18 18
19 def HandleGet(self): 19 def HandleGet(self):
20 settings = CrashConfigModel.Get() 20 settings = CrashConfigModel.Get()
21 21
22 data = { 22 data = {
23 'fracas': settings.fracas, 23 'fracas': settings.fracas,
24 'cracas': settings.cracas,
24 'component_classifier': settings.component_classifier, 25 'component_classifier': settings.component_classifier,
25 'project_classifier': settings.project_classifier, 26 'project_classifier': settings.project_classifier,
26 } 27 }
27 28
28 return {'template': 'crash/crash_config.html', 'data': data} 29 return {'template': 'crash/crash_config.html', 'data': data}
29 30
30 def HandlePost(self): 31 def HandlePost(self):
31 data = self.request.params.get('data') 32 data = self.request.params.get('data')
32 new_config_dict = json.loads(data) 33 new_config_dict = json.loads(data)
33 34
34 crash_config = CrashConfigModel.Get() 35 crash_config = CrashConfigModel.Get()
35 36
36 crash_config.ClearCache() 37 crash_config.ClearCache()
37 crash_config.Update( 38 crash_config.Update(
38 users.get_current_user(), users.IsCurrentUserAdmin(), **new_config_dict) 39 users.get_current_user(), users.IsCurrentUserAdmin(), **new_config_dict)
39 return self.HandleGet() 40 return self.HandleGet()
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/model/crash/crash_config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698