mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-28 18:52:31 +01:00
potential integration test fix
This commit is contained in:
parent
7736c351e4
commit
6734ab0ac4
@ -221,7 +221,7 @@ def index_doc_batch_prepare(
|
|||||||
else documents
|
else documents
|
||||||
)
|
)
|
||||||
if len(updatable_docs) != len(documents):
|
if len(updatable_docs) != len(documents):
|
||||||
updatable_doc_ids = [doc.id for doc in updatable_docs]
|
updatable_doc_ids = {doc.id for doc in updatable_docs}
|
||||||
skipped_doc_ids = [
|
skipped_doc_ids = [
|
||||||
doc.id for doc in documents if doc.id not in updatable_doc_ids
|
doc.id for doc in documents if doc.id not in updatable_doc_ids
|
||||||
]
|
]
|
||||||
|
@ -78,7 +78,7 @@ USERS_PAGE_SIZE = 10
|
|||||||
@router.patch("/manage/set-user-role")
|
@router.patch("/manage/set-user-role")
|
||||||
def set_user_role(
|
def set_user_role(
|
||||||
user_role_update_request: UserRoleUpdateRequest,
|
user_role_update_request: UserRoleUpdateRequest,
|
||||||
current_user: User = Depends(current_admin_user),
|
current_user: User | None = Depends(current_admin_user),
|
||||||
db_session: Session = Depends(get_session),
|
db_session: Session = Depends(get_session),
|
||||||
) -> None:
|
) -> None:
|
||||||
user_to_update = get_user_by_email(
|
user_to_update = get_user_by_email(
|
||||||
@ -98,7 +98,7 @@ def set_user_role(
|
|||||||
current_role=current_role,
|
current_role=current_role,
|
||||||
)
|
)
|
||||||
|
|
||||||
if user_to_update.id == current_user.id:
|
if current_user and user_to_update.id == current_user.id:
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=400,
|
status_code=400,
|
||||||
detail="An admin cannot demote themselves from admin role!",
|
detail="An admin cannot demote themselves from admin role!",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user