This commit is contained in:
Valentin CZERYBA 2023-11-03 21:00:47 +01:00
parent ce0ba3e55b
commit 4f6a057eca

View File

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