mirror of
https://github.com/danswer-ai/danswer.git
synced 2025-03-17 21:32:36 +01:00
potential integration test fix
This commit is contained in:
parent
7736c351e4
commit
6734ab0ac4
backend/onyx
@ -221,7 +221,7 @@ def index_doc_batch_prepare(
|
||||
else 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 = [
|
||||
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")
|
||||
def set_user_role(
|
||||
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),
|
||||
) -> None:
|
||||
user_to_update = get_user_by_email(
|
||||
@ -98,7 +98,7 @@ def set_user_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(
|
||||
status_code=400,
|
||||
detail="An admin cannot demote themselves from admin role!",
|
||||
|
Loading…
x
Reference in New Issue
Block a user