Chromium Code Reviews| Index: dashboard/dashboard/create_health_report.py |
| diff --git a/dashboard/dashboard/create_health_report.py b/dashboard/dashboard/create_health_report.py |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9a995545e83a3949a1aa4344910f4e4d703965a6 |
| --- /dev/null |
| +++ b/dashboard/dashboard/create_health_report.py |
| @@ -0,0 +1,32 @@ |
| +# Copyright 2017 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. |
| + |
| +"""Provides the web interface for adding and editing sheriff rotations.""" |
| + |
| +from dashboard.common import request_handler |
| +from dashboard.common import xsrf |
| +from dashboard.models import table_config |
| + |
| + |
| +class CreateHealthReportHandler(request_handler.RequestHandler): |
| + |
| + def get(self): |
| + """Renders the UI with the form fields.""" |
| + self.RenderHtml('create_health_report.html', {}) |
| + |
| + @xsrf.TokenRequired |
| + def post(self): |
| + """POSTS the data to the datastore.""" |
| + internal_only = self.request.get('internal-only') == 'true' |
| + name = self.request.get('name') |
| + 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
|
| + tests = self.request.get('tests').splitlines() |
| + table_layout = self.request.get('tableLayout') |
| + |
| + table_config.TableConfig(name=name, bots=master_bot, tests=tests, |
| + table_layout=table_layout, |
| + internal_only=internal_only).put() |
| + |
| + self.RenderHtml('create_health_report.html', |
| + {'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.
|