From 7df1b8cc0f30fda4411018b9b4205c2e50710bb9 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Fri, 12 May 2023 01:06:09 +0100 Subject: [PATCH] Remove old restore method --- app/blueprints/admin/admin.py | 12 +----------- app/templates/admin/list.html | 29 +---------------------------- 2 files changed, 2 insertions(+), 39 deletions(-) diff --git a/app/blueprints/admin/admin.py b/app/blueprints/admin/admin.py index eea4d952..1d55d7c2 100644 --- a/app/blueprints/admin/admin.py +++ b/app/blueprints/admin/admin.py @@ -30,17 +30,7 @@ from ...models import UserRank, Package, db, PackageState, User, AuditSeverity, def admin_page(): if request.method == "POST": action = request.form["action"] - - if action == "restore": - package = Package.query.get(request.form["package"]) - if package is None: - flash("Unknown package", "danger") - else: - package.state = PackageState.READY_FOR_REVIEW - db.session.commit() - return redirect(url_for("admin.admin_page")) - - elif action in actions: + if action in actions: ret = actions[action]["func"]() if ret: return ret diff --git a/app/templates/admin/list.html b/app/templates/admin/list.html index 83337c96..0b5b9718 100644 --- a/app/templates/admin/list.html +++ b/app/templates/admin/list.html @@ -9,6 +9,7 @@
- -
-

Restore Package

- -
- - -
- - -
-
- -
- - - -

- {{ _("Deletion is permanent.") }} -

- - -
-
{% endblock %}