MCPcopy Index your code
hub / github.com/0010aor/FlashNotes / create_user

Function create_user

backend/src/users/services.py:15–22  ·  view source on GitHub ↗
(*, session: Session, user_create: UserCreate)

Source from the content-addressed store, hash-verified

13
14
15def create_user(*, session: Session, user_create: UserCreate) -> User:
16 db_obj = User.model_validate(
17 user_create, update={"hashed_password": get_password_hash(user_create.password)}
18 )
19 session.add(db_obj)
20 session.commit()
21 session.refresh(db_obj)
22 return db_obj
23
24
25def update_user(*, session: Session, db_user: User, user_in: UserUpdate) -> Any:

Callers 15

init_dbFunction · 0.90
test_userFunction · 0.90
test_create_userFunction · 0.90
test_get_userFunction · 0.90
test_get_user_by_emailFunction · 0.90
test_update_userFunction · 0.90
test_authenticate_userFunction · 0.90
test_create_access_tokenFunction · 0.90

Calls 1

get_password_hashFunction · 0.90

Tested by 15

test_userFunction · 0.72
test_create_userFunction · 0.72
test_get_userFunction · 0.72
test_get_user_by_emailFunction · 0.72
test_update_userFunction · 0.72
test_authenticate_userFunction · 0.72
test_create_access_tokenFunction · 0.72
test_userFunction · 0.72