diff --git a/app/routers/users.py b/app/routers/users.py index 23f6ffb..1f33b0e 100644 --- a/app/routers/users.py +++ b/app/routers/users.py @@ -154,7 +154,7 @@ async def update_users_id(authorize: Annotated[bool, Depends(permissions_checker ) user_repository = users.UserRepository(database=database.database) - user = user_repository.find_one_by({"username": {'$eq': userSingle.username}}) + user = user_repository.find_one_by({"$or":[{"username": {'$eq': userSingle.username}}, {"email": {"$eq": userSingle.email}}]}) if user is None: response.status_code = status.HTTP_201_CREATED user = users.User(username=userSingle.username, password=users_token.get_password_hash(userSingle.password), email=userSingle.email)