open-webui/backend/open_webui
G30 48ea043f82
fix(prompts): resolve undefined session variable in _get_access_grants and _to_prompt_model (#25129)
Both _get_access_grants and _to_prompt_model referenced an undefined
local variable 'session' instead of the 'db' parameter passed to each
method. Because these helpers are called outside of any
'async with get_async_db_context()' block, 'session' did not exist in
their scope, causing a NameError on every prompt fetch.

The NameError was silently swallowed by the broad 'except Exception'
clause in get_prompt_by_id, which returned None — causing the frontend
[id]/+page.svelte to immediately redirect back to /workspace/prompts
rather than rendering the prompt editor.

Also adds the missing 'logging' import and module-level 'log' logger,
which was referenced (but never imported) in insert_new_prompt,
update_prompt_version, and delete_prompt_by_id.
2026-05-28 16:23:25 -05:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal refac 2026-05-21 16:25:25 +04:00
migrations refac 2026-05-21 15:29:49 +04:00
models fix(prompts): resolve undefined session variable in _get_access_grants and _to_prompt_model (#25129) 2026-05-28 16:23:25 -05:00
retrieval refac 2026-05-21 16:44:36 +04:00
routers refac 2026-05-28 16:19:35 -05:00
socket fix: resolve NameError for redis_sentinels in session_cleanup_lock 2026-05-21 13:41:21 +04:00
static refac 2026-05-12 03:04:35 +09:00
storage refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
tools refac 2026-05-21 16:44:36 +04:00
utils refac: clean up Redis sentinel utilities and import grouping 2026-05-21 11:47:25 +04:00
__init__.py refac 2026-05-09 02:38:08 +09:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py refac 2026-05-21 16:56:56 +04:00
constants.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00
env.py refac 2026-05-20 00:22:27 +04:00
functions.py fix: emit [DONE] for AsyncGenerator pipe returns (#24763) 2026-05-19 22:07:56 +04:00
main.py refac 2026-05-21 16:56:56 +04:00
tasks.py refac: modernize type annotations (PEP 604 / PEP 585) 2026-05-12 17:10:15 +09:00