mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-08 03:08:02 +00:00
refac
This commit is contained in:
parent
646a568ae6
commit
a3a81fee03
1 changed files with 9 additions and 0 deletions
|
|
@ -593,6 +593,9 @@ async def get_function_user_valves_spec_by_id(
|
|||
):
|
||||
function = await Functions.get_function_by_id(id, db=db)
|
||||
if function:
|
||||
if not function.is_active:
|
||||
return None
|
||||
|
||||
function_module, function_type, frontmatter = await get_function_module_from_cache(request, id)
|
||||
|
||||
if hasattr(function_module, 'UserValves'):
|
||||
|
|
@ -620,6 +623,12 @@ async def update_function_user_valves_by_id(
|
|||
function = await Functions.get_function_by_id(id, db=db)
|
||||
|
||||
if function:
|
||||
if not function.is_active:
|
||||
raise HTTPException(
|
||||
status_code=status.HTTP_400_BAD_REQUEST,
|
||||
detail='Function is not active',
|
||||
)
|
||||
|
||||
function_module, function_type, frontmatter = await get_function_module_from_cache(request, id)
|
||||
|
||||
if hasattr(function_module, 'UserValves'):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue