mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 06:03:26 -05:00
[PR #22594] [MERGED] refactor: modernize type hints and imports in access_control module #97812
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/22594
Author: @ashm-dev
Created: 3/11/2026
Status: ✅ Merged
Merged: 3/11/2026
Merged by: @tjbck
Base:
dev← Head:refac/access-control-type-hints📝 Commits (1)
44d5d9arefac: modernize type hints and imports in access_control module📊 Changes
2 files changed (+32 additions, -32 deletions)
View changed files
📝
backend/open_webui/utils/access_control/__init__.py(+28 -29)📝
backend/open_webui/utils/access_control/files.py(+4 -3)📄 Description
Pull Request Checklist
devsqlalchemyalready used throughout the project.dev.refactorChangelog Entry
Description
access_control/__init__.pyandaccess_control/files.pyto use built-in generics and PEP 604 union syntax. Replace untypeddb: Optional[Any]withdb: Session | Nonefor better static analysis and IDE support.Added
Changed
typing.Dict,List,Set,Optionalwith built-indict,list,setandX | Nonesyntax (PEP 585 / PEP 604)dbparameter asSession | Noneinstead ofOptional[Any]across all functions in both filesaccess_grantshelpers to top-level imports in__init__.pyUsersimport from__init__.pySessionimport style tofrom sqlalchemy.orm import Sessionin both filesDeprecated
Removed
Usersimport fromopen_webui.models.userstypingimports (Dict,List,Set,Optional,Union)Fixed
Security
Breaking Changes
Additional Information
Screenshots or Videos
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.