From fc09ed8725487002c0d4f90f2044f7a0f7562d98 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 21 Feb 2019 22:04:19 -0500 Subject: [PATCH] Use @loginrequired after route decorator --- buildsrht/blueprints/jobs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildsrht/blueprints/jobs.py b/buildsrht/blueprints/jobs.py index 2cec7c2..138c408 100644 --- a/buildsrht/blueprints/jobs.py +++ b/buildsrht/blueprints/jobs.py @@ -116,16 +116,16 @@ def index(): Job.query.filter(Job.owner_id == current_user.id), "index.html") -@loginrequired @jobs.route("/submit") +@loginrequired def submit_GET(): manifest = session.get("manifest") if manifest: del session["manifest"] return render_template("submit.html", manifest=manifest) -@loginrequired @jobs.route("/resubmit/") +@loginrequired def resubmit_GET(job_id): job = Job.query.filter(Job.id == job_id).one_or_none() if not job: @@ -133,8 +133,8 @@ def resubmit_GET(job_id): session["manifest"] = job.manifest return redirect("/submit") -@loginrequired @jobs.route("/submit", methods=["POST"]) +@loginrequired def submit_POST(): valid = Validation(request) _manifest = valid.require("manifest", friendly_name="Manifest") @@ -162,8 +162,8 @@ def submit_POST(): queue_build(job, manifest) # commits the session return redirect("/~" + current_user.username + "/job/" + str(job.id)) -@loginrequired @jobs.route("/cancel/", methods=["POST"]) +@loginrequired def cancel(job_id): job = Job.query.filter(Job.id == job_id).one_or_none() if not job: -- 2.38.5