diff --git a/app/routers/mail.py b/app/routers/mail.py index 247210c..919402e 100644 --- a/app/routers/mail.py +++ b/app/routers/mail.py @@ -15,7 +15,7 @@ async def read_users_me(userSingle: users.UserCreate | None = None): detail="Body request is empty" ) 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 not None: raise HTTPException( status_code=status.HTTP_204_NO_CONTENT,