add or
This commit is contained in:
parent
ce0ba3e55b
commit
4f6a057eca
@ -154,7 +154,7 @@ async def update_users_id(authorize: Annotated[bool, Depends(permissions_checker
|
|||||||
)
|
)
|
||||||
user_repository = users.UserRepository(database=database.database)
|
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:
|
if user is None:
|
||||||
response.status_code = status.HTTP_201_CREATED
|
response.status_code = status.HTTP_201_CREATED
|
||||||
user = users.User(username=userSingle.username, password=users_token.get_password_hash(userSingle.password), email=userSingle.email)
|
user = users.User(username=userSingle.username, password=users_token.get_password_hash(userSingle.password), email=userSingle.email)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user