| OLD | NEW |
| (Empty) | |
| 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 |
| 3 # found in the LICENSE file. |
| 4 |
| 5 """Handles requests to the crash config page.""" |
| 6 |
| 7 import json |
| 8 |
| 9 from base_handler import BaseHandler |
| 10 from base_handler import Permission |
| 11 from model.crash.crash_config import CrashConfig as CrashConfigModel |
| 12 |
| 13 |
| 14 class CrashConfig(BaseHandler): |
| 15 PERMISSION_LEVEL = Permission.ADMIN |
| 16 |
| 17 def HandleGet(self): |
| 18 settings = CrashConfigModel.Get() |
| 19 |
| 20 data = { |
| 21 'fracas': settings.fracas, |
| 22 } |
| 23 |
| 24 return {'template': 'crash/crash_config.html', 'data': data} |
| 25 |
| 26 def HandlePost(self): |
| 27 data = self.request.params.get('data') |
| 28 new_config_dict = json.loads(data) |
| 29 CrashConfigModel.Get().Update(**new_config_dict) |
| 30 return self.HandleGet() |
| OLD | NEW |