Fix outdated packages page query

This commit is contained in:
rubenwardy 2021-01-29 22:35:41 +00:00
parent 09f8302e74
commit 53babc1113
2 changed files with 6 additions and 7 deletions

@ -182,9 +182,10 @@ def view_user(username=None):
@bp.route("/todo/outdated/")
@login_required
def outdated():
outdated_packages = Package.query \
.filter(Package.state == PackageState.APPROVED,
Package.update_config.has(PackageUpdateConfig.outdated_at.isnot(None)))\
.order_by(db.desc(PackageUpdateConfig.outdated_at)).all()
outdated_packages = db.session.query(Package).select_from(PackageUpdateConfig) \
.filter(PackageUpdateConfig.outdated_at.isnot(None)) \
.order_by(db.desc(PackageUpdateConfig.outdated_at)) \
.join(PackageUpdateConfig.package) \
.filter(Package.state == PackageState.APPROVED).all()
return render_template("todo/outdated.html", current_tab="outdated", outdated_packages=outdated_packages)

@ -1,12 +1,10 @@
{% extends "todo/todo_base.html" %}
{% block title %}
{{ _("Outdated packages") }}
{{ _("All Outdated packages") }}
{% endblock %}
{% block content %}
<h2>{{ self.title() }}</h2>
{% from "macros/todo.html" import render_outdated_packages %}
{{ render_outdated_packages(outdated_packages) }}
{% endblock %}