Skip to content

Commit 0d2d625

Browse files
authored
fix(admin): strip whitespace from value (#18480)
1 parent a8bfe81 commit 0d2d625

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/unit/admin/views/test_organizations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ def test_rename(self, db_request):
557557

558558
db_request.matchdict = {"organization_id": organization.id}
559559
db_request.params = {
560-
"new_organization_name": "widget",
560+
"new_organization_name": " widget ", # Test trimming whitespace
561561
}
562562
db_request.user = admin
563563
db_request.route_path = pretend.call_recorder(_organization_application_routes)

warehouse/admin/views/organizations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def organization_rename(request):
313313
raise HTTPNotFound
314314

315315
old_organization_name = organization.name
316-
new_organization_name = request.params.get("new_organization_name")
316+
new_organization_name = request.params.get("new_organization_name").strip()
317317

318318
try:
319319
organization_service.rename_organization(organization_id, new_organization_name)

0 commit comments

Comments
 (0)