mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-07 03:18:23 -05:00
[PR #22295] [CLOSED] fix(users): return 403 for blocked primary admin role downgrade #26596
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22295
Author: @haosenwang1018
Created: 3/6/2026
Status: ❌ Closed
Base:
main← Head:fix/users-update-primary-admin-http-status📝 Commits (1)
72ddd4afix(users): preserve 403 when primary admin role change is blocked📊 Changes
2 files changed (+15 additions, -0 deletions)
View changed files
📝
backend/open_webui/routers/users.py(+2 -0)📝
backend/open_webui/test/apps/webui/routers/test_users.py(+13 -0)📄 Description
Summary
/{user_id}/updatetest_users.pyfor primary-admin role downgrade attemptsWhy
The endpoint intentionally blocks changing the first admin's role away from
admin, but the broad exception handler catches that HTTPException and rethrows a 500. This patch keeps the intended 403 status code.Testing
test.util.abstract_integration_testmodule🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.