From 324815d58dfbaa75ae6213476c336a621eae376a Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 30 Jan 2021 15:45:48 +0000 Subject: [PATCH] Default to sort=score on All Outdated Packages --- app/blueprints/todo/__init__.py | 7 ++++--- app/templates/todo/outdated.html | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/blueprints/todo/__init__.py b/app/blueprints/todo/__init__.py index e09e774..d03d207 100644 --- a/app/blueprints/todo/__init__.py +++ b/app/blueprints/todo/__init__.py @@ -180,10 +180,11 @@ def outdated(): .filter(Package.state == PackageState.APPROVED) sort_by = request.args.get("sort") - if sort_by == "score": - query = query.order_by(db.desc(Package.score)) - else: + if sort_by == "date": query = query.order_by(db.desc(PackageUpdateConfig.outdated_at)) + else: + sort_by = "score" + query = query.order_by(db.desc(Package.score)) return render_template("todo/outdated.html", current_tab="outdated", outdated_packages=query.all(), sort_by=sort_by) diff --git a/app/templates/todo/outdated.html b/app/templates/todo/outdated.html index 5480fad..0986ab2 100644 --- a/app/templates/todo/outdated.html +++ b/app/templates/todo/outdated.html @@ -6,7 +6,7 @@ {% block content %}
- Sort by date