mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
refac: check the owner's role before continuing a chat after a subagent finishes (#31451)
The parent chat now only continues with a finished subagent's result while its owner still has a verified role, the same check timers already make.
This commit is contained in:
parent
eda8d85361
commit
31a09a1eeb
1 changed files with 2 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ from open_webui.models.chats import Chat, ChatForm, Chats
|
|||
from open_webui.models.config import Config
|
||||
from open_webui.models.users import UserModel, Users
|
||||
from open_webui.tasks import create_task, has_active_tasks
|
||||
from open_webui.utils.auth import create_token
|
||||
from open_webui.utils.auth import VERIFIED_USER_ROLES, create_token
|
||||
from open_webui.utils.json_codec import JSONCodec
|
||||
from open_webui.utils.misc import get_message_list
|
||||
from sqlalchemy import select
|
||||
|
|
@ -84,7 +84,7 @@ async def process_pending_internal_messages(
|
|||
return
|
||||
|
||||
user = await Users.get_user_by_id(user_id)
|
||||
if not user:
|
||||
if not user or user.role not in VERIFIED_USER_ROLES:
|
||||
return
|
||||
|
||||
async with get_async_db() as db:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue