| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 findit config page.""" | 5 """Handles requests to the findit config page.""" |
| 6 | 6 |
| 7 import json | 7 import json |
| 8 | 8 |
| 9 from common.base_handler import BaseHandler | 9 from common.base_handler import BaseHandler, Permission |
| 10 from common.base_handler import Permission | |
| 11 from model import wf_config | 10 from model import wf_config |
| 12 from waterfall import waterfall_config | 11 from waterfall import waterfall_config |
| 13 | 12 |
| 14 from google.appengine.api import users | 13 from google.appengine.api import users |
| 15 | 14 |
| 16 | 15 |
| 17 def _RemoveDuplicatesAndSort(elements): | 16 def _RemoveDuplicatesAndSort(elements): |
| 18 return list(set(elements)) | 17 return list(set(elements)) |
| 19 | 18 |
| 20 | 19 |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 new_config_dict = json.loads(data) | 280 new_config_dict = json.loads(data) |
| 282 if not _ConfigurationDictIsValid(new_config_dict): # pragma: no cover | 281 if not _ConfigurationDictIsValid(new_config_dict): # pragma: no cover |
| 283 return self.CreateError( | 282 return self.CreateError( |
| 284 'New configuration settings is not properly formatted.', 400) | 283 'New configuration settings is not properly formatted.', 400) |
| 285 | 284 |
| 286 wf_config.FinditConfig.Get().Update(users.get_current_user(), | 285 wf_config.FinditConfig.Get().Update(users.get_current_user(), |
| 287 users.IsCurrentUserAdmin(), | 286 users.IsCurrentUserAdmin(), |
| 288 **new_config_dict) | 287 **new_config_dict) |
| 289 | 288 |
| 290 return self.HandleGet() | 289 return self.HandleGet() |
| OLD | NEW |