mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-06-13 17:40:57 +02:00
Fix /chat-session-history/{chat_session_id} endpoint when auth is enabled
This commit is contained in:
parent
ce870ff577
commit
e11f0f6202
@ -208,12 +208,14 @@ def get_chat_session_history(
|
|||||||
@router.get("/admin/chat-session-history/{chat_session_id}")
|
@router.get("/admin/chat-session-history/{chat_session_id}")
|
||||||
def get_chat_session(
|
def get_chat_session(
|
||||||
chat_session_id: int,
|
chat_session_id: int,
|
||||||
_: db_models.User | None = Depends(current_admin_user),
|
user: db_models.User | None = Depends(current_admin_user),
|
||||||
db_session: Session = Depends(get_session),
|
db_session: Session = Depends(get_session),
|
||||||
) -> ChatSessionSnapshot:
|
) -> ChatSessionSnapshot:
|
||||||
try:
|
try:
|
||||||
chat_session = get_chat_session_by_id(
|
chat_session = get_chat_session_by_id(
|
||||||
chat_session_id=chat_session_id, user_id=None, db_session=db_session
|
chat_session_id=chat_session_id,
|
||||||
|
user_id=user.id if user else None,
|
||||||
|
db_session=db_session,
|
||||||
)
|
)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user