mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-09 06:27:38 +01:00
Fix unfulfilled dependency checker
This commit is contained in:
parent
d7c765c972
commit
7a650eb1e4
@ -56,7 +56,7 @@ def del_stuck_releases():
|
|||||||
return redirect(url_for("admin.admin_page"))
|
return redirect(url_for("admin.admin_page"))
|
||||||
|
|
||||||
|
|
||||||
@action("Check ZIP releases")
|
@action("Check all releases (postReleaseCheckUpdate)")
|
||||||
def check_releases():
|
def check_releases():
|
||||||
releases = PackageRelease.query.filter(PackageRelease.url.like("/uploads/%")).all()
|
releases = PackageRelease.query.filter(PackageRelease.url.like("/uploads/%")).all()
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ def check_releases():
|
|||||||
return redirect(url_for("todo.view_editor"))
|
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():
|
def reimport_packages():
|
||||||
tasks = []
|
tasks = []
|
||||||
for package in Package.query.filter(Package.state != PackageState.DELETED).all():
|
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")))
|
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():
|
def import_screenshots():
|
||||||
packages = Package.query \
|
packages = Package.query \
|
||||||
.filter(Package.state != PackageState.DELETED) \
|
.filter(Package.state != PackageState.DELETED) \
|
||||||
@ -283,7 +283,7 @@ def import_licenses():
|
|||||||
|
|
||||||
@action("Delete inactive users")
|
@action("Delete inactive users")
|
||||||
def 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()
|
User.rank == UserRank.NOT_JOINED).all()
|
||||||
for user in users:
|
for user in users:
|
||||||
db.session.delete(user)
|
db.session.delete(user)
|
||||||
|
@ -74,7 +74,7 @@ def view_editor():
|
|||||||
|
|
||||||
unfulfilled_meta_packages = MetaPackage.query \
|
unfulfilled_meta_packages = MetaPackage.query \
|
||||||
.filter(~ MetaPackage.packages.any(state=PackageState.APPROVED)) \
|
.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()
|
.order_by(db.asc(MetaPackage.name)).count()
|
||||||
|
|
||||||
return render_template("todo/editor.html", current_tab="editor",
|
return render_template("todo/editor.html", current_tab="editor",
|
||||||
@ -143,7 +143,7 @@ def tags_user():
|
|||||||
def metapackages():
|
def metapackages():
|
||||||
mpackages = MetaPackage.query \
|
mpackages = MetaPackage.query \
|
||||||
.filter(~ MetaPackage.packages.any(state=PackageState.APPROVED)) \
|
.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()
|
.order_by(db.asc(MetaPackage.name)).all()
|
||||||
|
|
||||||
return render_template("todo/metapackages.html", mpackages=mpackages)
|
return render_template("todo/metapackages.html", mpackages=mpackages)
|
||||||
|
@ -123,22 +123,22 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if total_to_tag != 0 %}
|
||||||
|
<h2 class="mt-5">{{ _("Tag Packages") }}</h2>
|
||||||
|
|
||||||
<h2 class="mt-5">{{ _("Tag Packages") }}</h2>
|
<p>
|
||||||
|
{{ _("%(total_to_tag)d / %(total_packages)d packages don't have any tags.",
|
||||||
|
total_to_tag=total_to_tag, total_packages=total_packages) }}
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>
|
<div class="progress my-4">
|
||||||
{{ _("%(total_to_tag)d / %(total_packages)d packages don't have any tags.",
|
{% set perc = 100 * (total_packages - total_to_tag) / total_packages %}
|
||||||
total_to_tag=total_to_tag, total_packages=total_packages) }}
|
<div class="progress-bar bg-success" role="progressbar"
|
||||||
</p>
|
style="width: {{ perc }}%" aria-valuenow="{{ perc }}" aria-valuemin="0" aria-valuemax="100"></div>
|
||||||
|
</div>
|
||||||
<div class="progress my-4">
|
|
||||||
{% set perc = 100 * (total_packages - total_to_tag) / total_packages %}
|
|
||||||
<div class="progress-bar bg-success" role="progressbar"
|
|
||||||
style="width: {{ perc }}%" aria-valuenow="{{ perc }}" aria-valuemin="0" aria-valuemax="100"></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<a class="btn btn-primary" href="{{ url_for('todo.tags') }}">{{ _("View Tags") }}</a>
|
|
||||||
|
|
||||||
|
<a class="btn btn-primary" href="{{ url_for('todo.tags') }}">{{ _("View Tags") }}</a>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if unfulfilled_meta_packages %}
|
{% if unfulfilled_meta_packages %}
|
||||||
<h2 class="mt-5">
|
<h2 class="mt-5">
|
||||||
|
Loading…
Reference in New Issue
Block a user