From 24ec254f5a8b900c3ec5423aabd282145f67b253 Mon Sep 17 00:00:00 2001 From: Tom Powell Date: Thu, 1 Nov 2018 00:02:25 -0700 Subject: [PATCH] filter runners by sponsor name --- test.py | 9 +++++++++ ui/app.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/test.py b/test.py index ea4b189..40121fa 100644 --- a/test.py +++ b/test.py @@ -113,5 +113,14 @@ class TestWeb(UsesModels): response = self.client.get("/") assert response.status_code == 200 + response = self.client.get("/runners/") + assert response.status_code == 200 + + response = self.client.get("/runners/foobar") + assert response.status_code == 200 + + response = self.client.get("/?status=success&device=mako") + assert response.status_code == 200 + if __name__ == "__main__": unittest.main() diff --git a/ui/app.py b/ui/app.py index 1bfbdff..ed67d7c 100644 --- a/ui/app.py +++ b/ui/app.py @@ -66,7 +66,7 @@ def runner(runner): @app.route("/runners/") def runners(): - runners = models.Runner.query.all() + runners = models.Runner.query.order_by(models.Runner.runner_sponsor).all() return render_template('runners.html', runners=runners) @app.route("/webhook", methods=('POST',)) -- 2.20.1