Fix implicit None returns in get_model_by_id, get_knowledge_by_id, get_tools_by_id, and get_prompt_by_command. Now properly returns 401 for access denied and 404 for not found instead of silently returning None.
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
Note
Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/open-webui/open-webui/pull/20280
**Author:** [@Classic298](https://github.com/Classic298)
**Created:** 12/30/2025
**Status:** ✅ Merged
**Merged:** 12/31/2025
**Merged by:** [@tjbck](https://github.com/tjbck)
**Base:** `dev` ← **Head:** `fix/issue-009-019-021-implicit-none`
---
### 📝 Commits (1)
- [`4c99aa4`](https://github.com/open-webui/open-webui/commit/4c99aa4637392790e6471f2d642f91f8110d4435) fix: add explicit HTTPException for access control failures
### 📊 Changes
**4 files changed** (+24 additions, -4 deletions)
<details>
<summary>View changed files</summary>
📝 `backend/open_webui/routers/knowledge.py` (+6 -1)
📝 `backend/open_webui/routers/models.py` (+6 -1)
📝 `backend/open_webui/routers/prompts.py` (+6 -1)
📝 `backend/open_webui/routers/tools.py` (+6 -1)
</details>
### 📄 Description
Fix implicit None returns in get_model_by_id, get_knowledge_by_id, get_tools_by_id, and get_prompt_by_command. Now properly returns 401 for access denied and 404 for not found instead of silently returning None.
### Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms.
> [!NOTE]
> Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/20280
Author: @Classic298
Created: 12/30/2025
Status: ✅ Merged
Merged: 12/31/2025
Merged by: @tjbck
Base:
dev← Head:fix/issue-009-019-021-implicit-none📝 Commits (1)
4c99aa4fix: add explicit HTTPException for access control failures📊 Changes
4 files changed (+24 additions, -4 deletions)
View changed files
📝
backend/open_webui/routers/knowledge.py(+6 -1)📝
backend/open_webui/routers/models.py(+6 -1)📝
backend/open_webui/routers/prompts.py(+6 -1)📝
backend/open_webui/routers/tools.py(+6 -1)📄 Description
Fix implicit None returns in get_model_by_id, get_knowledge_by_id, get_tools_by_id, and get_prompt_by_command. Now properly returns 401 for access denied and 404 for not found instead of silently returning None.
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.