diff --git a/app/blueprints/admin/actions.py b/app/blueprints/admin/actions.py index 02694dd4..37fd65a7 100644 --- a/app/blueprints/admin/actions.py +++ b/app/blueprints/admin/actions.py @@ -56,7 +56,7 @@ def del_stuck_releases(): return redirect(url_for("admin.admin_page")) -@action("Check ZIP releases") +@action("Check all releases (postReleaseCheckUpdate)") def check_releases(): releases = PackageRelease.query.filter(PackageRelease.url.like("/uploads/%")).all() @@ -73,7 +73,7 @@ def check_releases(): return redirect(url_for("todo.view_editor")) -@action("Check the first release of all packages") +@action("Check latest release of all packages (postReleaseCheckUpdate)") def reimport_packages(): tasks = [] for package in Package.query.filter(Package.state != PackageState.DELETED).all(): @@ -102,7 +102,7 @@ def check_all_forum_accounts(): return redirect(url_for("tasks.check", id=task.id, r=url_for("admin.admin_page"))) -@action("Import screenshots") +@action("Import screenshots from Git") def import_screenshots(): packages = Package.query \ .filter(Package.state != PackageState.DELETED) \ @@ -283,7 +283,7 @@ def import_licenses(): @action("Delete inactive users") def delete_inactive_users(): - users = User.query.filter(User.is_active == False, User.packages.is_(None), User.forum_topics.is_(None), + users = User.query.filter(User.is_active == False, ~User.packages.any(), ~User.forum_topics.any(), User.rank == UserRank.NOT_JOINED).all() for user in users: db.session.delete(user) diff --git a/app/blueprints/todo/__init__.py b/app/blueprints/todo/__init__.py index edc99b00..c0ab1163 100644 --- a/app/blueprints/todo/__init__.py +++ b/app/blueprints/todo/__init__.py @@ -74,7 +74,7 @@ def view_editor(): unfulfilled_meta_packages = MetaPackage.query \ .filter(~ MetaPackage.packages.any(state=PackageState.APPROVED)) \ - .filter(MetaPackage.dependencies.any(Package.state == PackageState.APPROVED, optional=False)) \ + .filter(MetaPackage.dependencies.any(Dependency.depender.has(state=PackageState.APPROVED), optional=False)) \ .order_by(db.asc(MetaPackage.name)).count() return render_template("todo/editor.html", current_tab="editor", @@ -143,7 +143,7 @@ def tags_user(): def metapackages(): mpackages = MetaPackage.query \ .filter(~ MetaPackage.packages.any(state=PackageState.APPROVED)) \ - .filter(MetaPackage.dependencies.any(optional=False)) \ + .filter(MetaPackage.dependencies.any(Dependency.depender.has(state=PackageState.APPROVED), optional=False)) \ .order_by(db.asc(MetaPackage.name)).all() return render_template("todo/metapackages.html", mpackages=mpackages) diff --git a/app/templates/todo/editor.html b/app/templates/todo/editor.html index 6b01e9a6..a2aea148 100644 --- a/app/templates/todo/editor.html +++ b/app/templates/todo/editor.html @@ -123,22 +123,22 @@ {% endif %} + {% if total_to_tag != 0 %} +

{{ _("Tag Packages") }}

-

{{ _("Tag Packages") }}

+

+ {{ _("%(total_to_tag)d / %(total_packages)d packages don't have any tags.", + total_to_tag=total_to_tag, total_packages=total_packages) }} +

-

- {{ _("%(total_to_tag)d / %(total_packages)d packages don't have any tags.", - total_to_tag=total_to_tag, total_packages=total_packages) }} -

- -
- {% set perc = 100 * (total_packages - total_to_tag) / total_packages %} -
-
- - {{ _("View Tags") }} +
+ {% set perc = 100 * (total_packages - total_to_tag) / total_packages %} +
+
+ {{ _("View Tags") }} + {% endif %} {% if unfulfilled_meta_packages %}