filter runners by sponsor name
authorTom Powell <tom@powell.io>
Thu, 1 Nov 2018 07:02:25 +0000 (00:02 -0700)
committerTom Powell <tom@powell.io>
Thu, 1 Nov 2018 07:02:25 +0000 (00:02 -0700)
test.py
ui/app.py

diff --git a/test.py b/test.py
index ea4b18985188781b8aacecd1cecd84c9ed5ac8c2..40121fa2a3560f76c6e943eb297159b92243b276 100644 (file)
--- 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()
index 1bfbdffa4dcd04223f337bce83bab5903bc5c2d0..ed67d7ca20779f6b9a6bc59cf5430e06e7b04bff 100644 (file)
--- 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',))