This is an automated email from the ASF dual-hosted git repository.

sbp pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tooling-trusted-release.git


The following commit(s) were added to refs/heads/main by this push:
     new 87c64f3  Remove the temporary route to upgrade the database
87c64f3 is described below

commit 87c64f3eb99a65177bdcdaafaa09af1020e5b906
Author: Sean B. Palmer <[email protected]>
AuthorDate: Fri May 30 16:58:03 2025 +0100

    Remove the temporary route to upgrade the database
---
 atr/blueprints/admin/admin.py                      | 18 ----------------
 .../admin/templates/cleanup-incubating-names.html  | 25 ----------------------
 2 files changed, 43 deletions(-)

diff --git a/atr/blueprints/admin/admin.py b/atr/blueprints/admin/admin.py
index a594197..58a5922 100644
--- a/atr/blueprints/admin/admin.py
+++ b/atr/blueprints/admin/admin.py
@@ -326,24 +326,6 @@ async def admin_performance() -> str:
     return await template.render("performance.html", stats=sorted_summary)
 
 
[email protected]("/cleanup-incubating-names", methods=["GET", "POST"])
-async def admin_cleanup_incubating_names() -> str | response.Response:
-    form = await util.EmptyForm.create_form()
-    if await form.validate_on_submit():
-        updated_count = 0
-        async with db.session() as data:
-            async with data.begin():
-                projects = await data.project().all()
-                for project_model in projects:
-                    if project_model.full_name and 
project_model.full_name.endswith(" (Incubating)"):
-                        project_model.full_name = 
project_model.full_name.removesuffix(" (Incubating)")
-                        data.add(project_model)
-                        updated_count += 1
-        await quart.flash(f"Successfully removed ' (Incubating)' from 
{updated_count} project full_names.", "success")
-        return 
quart.redirect(quart.url_for("admin.admin_cleanup_incubating_names"))
-    return await template.render("cleanup-incubating-names.html", form=form)
-
-
 @admin.BLUEPRINT.route("/projects/update", methods=["GET", "POST"])
 async def admin_projects_update() -> str | response.Response | 
tuple[Mapping[str, Any], int]:
     """Update projects from remote data."""
diff --git a/atr/blueprints/admin/templates/cleanup-incubating-names.html 
b/atr/blueprints/admin/templates/cleanup-incubating-names.html
deleted file mode 100644
index 03853a9..0000000
--- a/atr/blueprints/admin/templates/cleanup-incubating-names.html
+++ /dev/null
@@ -1,25 +0,0 @@
-{% extends "layouts/base-admin.html" %}
-
-{% block title %}Cleanup incubating project names ~ ATR admin{% endblock %}
-
-{% block content %}
-        <h1 class="mb-4">Cleanup incubating project names</h1>
-        <p>
-          This action will remove the " (Incubating)" suffix from the full 
name of all projects where it is present.
-          This is a one time operation to help standardise project names in 
the database.
-        </p>
-
-        <div class="card shadow-sm mb-4">
-          <div class="card-body">
-            <h5 class="card-title">Confirm cleanup</h5>
-            <p class="card-text">
-              Press the button below to proceed with removing the " 
(Incubating)" suffix from project full names.
-              This change will be applied to the database immediately.
-            </p>
-            <form method="post" action="{{ 
url_for('admin.admin_cleanup_incubating_names') }}">
-              {{ form.csrf_token }}
-              <button type="submit" class="btn btn-danger">Cleanup project 
names</button>
-            </form>
-          </div>
-        </div>
-{% endblock %}


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to