[LNT] r311363 - Fix some cases where the submission page wouldn't render.
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 21 12:09:44 PDT 2017
Author: matze
Date: Mon Aug 21 12:09:44 2017
New Revision: 311363
URL: http://llvm.org/viewvc/llvm-project?rev=311363&view=rev
Log:
Fix some cases where the submission page wouldn't render.
Modified:
lnt/trunk/lnt/server/ui/views.py
lnt/trunk/tests/server/ui/V4Pages.py
Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=311363&r1=311362&r2=311363&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Mon Aug 21 12:09:44 2017
@@ -98,9 +98,6 @@ def index():
###
# Database Actions
def _do_submit():
- if request.method == 'GET':
- return render_template("submit_run.html")
-
assert request.method == 'POST'
input_file = request.files.get('file')
input_data = request.form.get('input_data')
@@ -164,6 +161,10 @@ def _do_submit():
@db_route('/submitRun', only_v3=False, methods=('GET', 'POST'))
def submit_run():
"""Compatibility url that hardcodes testsuite to 'nts'"""
+ if request.method == 'GET':
+ g.testsuite_name = 'nts'
+ return redirect(v4_url_for('.v4_submitRun'))
+
# This route doesn't know the testsuite to use. We have some defaults/
# autodetection for old submissions, but really you should use the full
# db_XXX/v4/YYYY/submitRun URL when using non-nts suites.
@@ -172,7 +173,9 @@ def submit_run():
@v4_route('/submitRun', methods=('GET', 'POST'))
-def submit_run_ts():
+def v4_submitRun():
+ if request.method == 'GET':
+ return render_template("submit_run.html")
return _do_submit()
###
Modified: lnt/trunk/tests/server/ui/V4Pages.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/V4Pages.py?rev=311363&r1=311362&r2=311363&view=diff
==============================================================================
--- lnt/trunk/tests/server/ui/V4Pages.py (original)
+++ lnt/trunk/tests/server/ui/V4Pages.py Mon Aug 21 12:09:44 2017
@@ -465,6 +465,10 @@ def main():
assert color2 is None
assert color1 != color3
+ check_redirect(client, '/db_default/submitRun',
+ '/db_default/v4/nts/submitRun')
+ check_code(client, '/db_default/v4/nts/submitRun')
+
# Now check the compile report
# Get the V4 overview page.
check_code(client, '/v4/compile/')
More information about the llvm-commits
mailing list