Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Copyright 2017 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 """Provides the web interface for adding and editing sheriff rotations.""" | |
| 6 | |
| 7 from dashboard.common import request_handler | |
| 8 from dashboard.common import xsrf | |
| 9 from dashboard.models import table_config | |
| 10 | |
| 11 | |
| 12 class CreateHealthReportHandler(request_handler.RequestHandler): | |
| 13 | |
| 14 def get(self): | |
| 15 """Renders the UI with the form fields.""" | |
| 16 self.RenderHtml('create_health_report.html', {}) | |
| 17 | |
| 18 @xsrf.TokenRequired | |
| 19 def post(self): | |
| 20 """POSTS the data to the datastore.""" | |
| 21 internal_only = self.request.get('internal-only') == 'true' | |
| 22 name = self.request.get('name') | |
| 23 master_bot = self.request.get('masterBot').splitlines() | |
|
sullivan
2017/01/11 20:59:15
It's poor security to rely on the user to supply w
jessimb
2017/01/11 21:31:21
Would that check go as a datastore pre-hook?
sullivan
2017/01/11 21:38:03
yep!
jessimb
2017/01/12 02:10:30
I have put this in the new CreateTableConfig() whi
| |
| 24 tests = self.request.get('tests').splitlines() | |
| 25 table_layout = self.request.get('tableLayout') | |
| 26 | |
| 27 table_config.TableConfig(name=name, bots=master_bot, tests=tests, | |
| 28 table_layout=table_layout, | |
| 29 internal_only=internal_only).put() | |
| 30 | |
| 31 self.RenderHtml('create_health_report.html', | |
| 32 {'msg': 'Health Report Created. View here: [TODO jessimb]'}) | |
|
sullivan
2017/01/11 20:59:15
We're trying to get away from jinja templates, bec
jessimb
2017/01/11 21:31:21
Making this a polymer element.
| |
| OLD | NEW |