Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Commit

Permalink
fix redirects to work with nginx settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Ernest Feret committed Jul 22, 2020
1 parent b1f5d5c commit be8f133
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rq_mantis/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def queue_requeue_all():
fq = get_failed_queue()
for job_id in fq.job_ids:
requeue_job(job_id)
return redirect(url_for('index', name='failed'))
return redirect(url_for('index', name='failed', _external=True))


@app.route("/queue/<name>/clear", methods=["POST"])
Expand All @@ -105,7 +105,7 @@ def queue_empty(name):

queue = get_queue_by_name(name)
queue.empty()
return redirect(url_for('queue_detail', name=name))
return redirect(url_for('queue_detail', name=name, _external=True))


@app.route("/queue/<name>")
Expand Down Expand Up @@ -138,7 +138,7 @@ def requeue_job(uuid):
return render_confirm()

rq.requeue_job(uuid)
return redirect(url_for('index', name='failed'))
return redirect(url_for('index', name='failed', _external=True))


@app.route("/queue/failed/job/<uuid>/clear", methods=["POST"])
Expand All @@ -148,13 +148,13 @@ def clear_failed_job(uuid):
return render_confirm()

get_failed_queue().remove(uuid)
return redirect(url_for('index', name='failed'))
return redirect(url_for('index', name='failed', _external=True))


@app.route("/queue/<name>/job/<uuid>/cancel")
def cancel(name, uuid):
rq.cancel_job(uuid)
return redirect(url_for('queue_detail', name=name))
return redirect(url_for('queue_detail', name=name, _external=True))


def render_confirm():
Expand Down

0 comments on commit be8f133

Please sign in to comment.