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

View File

@ -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
] ]

View File

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