[PR #11164] [CLOSED] chore: reduce nested if statements by using guard clauses #126330

Closed
opened 2026-05-21 07:29:02 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/11164
Author: @tidely
Created: 3/4/2025
Status: ❌ Closed

Base: dev ← Head: guards


📝 Commits (1)

  • 9b55353 chore: reduce nested if statements by using guard clauses

📊 Changes

1 file changed (+48 additions, -50 deletions)

View changed files

📝 backend/open_webui/routers/knowledge.py (+48 -50)

📄 Description

Description

This makes no functional changes to the code.

The goal of this PR is to improve readability by reducing the amount of indentation. Below a small before and after to see the indentation change

Before
After


🔄 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/11164 **Author:** [@tidely](https://github.com/tidely) **Created:** 3/4/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `guards` --- ### 📝 Commits (1) - [`9b55353`](https://github.com/open-webui/open-webui/commit/9b55353ac647a18fa7f2ca303547b11ca21af1ab) chore: reduce nested if statements by using guard clauses ### 📊 Changes **1 file changed** (+48 additions, -50 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/routers/knowledge.py` (+48 -50) </details> ### 📄 Description ## Description This makes no functional changes to the code. The goal of this PR is to improve readability by reducing the amount of indentation. Below a small before and after to see the indentation change ![Before](https://github.com/user-attachments/assets/cef89a40-4e07-49df-bb39-b6da4db27f9b) ![After](https://github.com/user-attachments/assets/83e52520-2b65-4f5b-8486-c66e4dbf30fb) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-21 07:29:02 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#126330