mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 14:02:24 +01:00
Add recalc package scores admin action
This commit is contained in:
parent
1eaa5d8767
commit
8db31ebfa9
@ -54,19 +54,6 @@ def del_stuck_releases():
|
||||
db.session.commit()
|
||||
return redirect(url_for("admin.admin_page"))
|
||||
|
||||
|
||||
@action("Import forum topic list")
|
||||
def import_topic_list():
|
||||
task = import_topic_list.delay()
|
||||
return redirect(url_for("tasks.check", id=task.id, r=url_for("todo.topics")))
|
||||
|
||||
|
||||
@action("Check all forum accounts")
|
||||
def check_all_forum_accounts():
|
||||
task = check_all_forum_accounts.delay()
|
||||
return redirect(url_for("tasks.check", id=task.id, r=url_for("admin.admin_page")))
|
||||
|
||||
|
||||
@action("Delete unused uploads")
|
||||
def clean_uploads():
|
||||
upload_dir = current_app.config['UPLOAD_DIR']
|
||||
@ -112,6 +99,29 @@ def del_mod_names():
|
||||
return redirect(url_for("admin.admin_page"))
|
||||
|
||||
|
||||
@action("Recalc package scores")
|
||||
def recalc_scores():
|
||||
for package in Package.query.all():
|
||||
package.recalculate_score()
|
||||
|
||||
db.session.commit()
|
||||
|
||||
flash("Recalculated package scores", "success")
|
||||
return redirect(url_for("admin.admin_page"))
|
||||
|
||||
|
||||
@action("Import forum topic list")
|
||||
def import_topic_list():
|
||||
task = import_topic_list.delay()
|
||||
return redirect(url_for("tasks.check", id=task.id, r=url_for("todo.topics")))
|
||||
|
||||
|
||||
@action("Check all forum accounts")
|
||||
def check_all_forum_accounts():
|
||||
task = check_all_forum_accounts.delay()
|
||||
return redirect(url_for("tasks.check", id=task.id, r=url_for("admin.admin_page")))
|
||||
|
||||
|
||||
@action("Run update configs")
|
||||
def run_update_config():
|
||||
check_for_updates.delay()
|
||||
|
Loading…
Reference in New Issue
Block a user