potential integration test fix

This commit is contained in:
Evan Lohn 2025-02-26 13:42:31 -08:00 committed by pablonyx
parent 7736c351e4
commit 6734ab0ac4
2 changed files with 3 additions and 3 deletions
backend/onyx
indexing
server/manage

@ -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!",