add or operator
This commit is contained in:
parent
dc4043acd9
commit
3392d8720f
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user