Skip to content

Commit

Permalink
Bug FIx with redirection after submission, use url_for method to co…
Browse files Browse the repository at this point in the history
…pe with `SCRIPT_NAME` environment value.
  • Loading branch information
marcoooo committed Dec 22, 2021
1 parent d89301b commit b631898
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ensembl/production/datacheck/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ensembl.production.core.models.hive import HiveInstance
from ensembl.production.core.server_utils import assert_mysql_uri, assert_mysql_db_uri
from flasgger import Swagger
from flask import Flask, json, jsonify, render_template, request, send_file, redirect, flash, abort
from flask import Flask, json, jsonify, render_template, request, send_file, redirect, flash, url_for
from flask_bootstrap import Bootstrap
from flask_cors import CORS
from requests.exceptions import HTTPError
Expand All @@ -30,8 +30,8 @@

import ensembl.production.datacheck.exceptions
from ensembl.production.datacheck.config import DatacheckConfig
from ensembl.production.datacheck.forms import DatacheckSubmissionForm
from ensembl.production.datacheck.exceptions import MissingIndexException
from ensembl.production.datacheck.forms import DatacheckSubmissionForm

# Go up two levels to get to root, where we will find the static and template files
app_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Expand Down Expand Up @@ -297,7 +297,7 @@ def job_submit(payload=None):
results = {"job_id": job.job_id}
return jsonify(results), 201
else:
return redirect('/jobs/' + str(job.job_id))
return redirect(url_for('job_result', job_id=str(job.job_id)))


@app.route('/jobs', methods=['GET'])
Expand Down

0 comments on commit b631898

Please sign in to comment.