Browse Source

Adding username when creating user from API

master
Ryan Reed 5 years ago
parent
commit
02479dc187
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      app/crud.py

+ 5
- 1
app/crud.py View File

@ -6,7 +6,11 @@ from . import models, schemas
# Create
def create_user(db: Session, user: schemas.UserCreate):
fake_hashed_password = user.password + "notreallyhashed" # Change to something later
db_user = models.User(email=user.email, hashed_password=fake_hashed_password)
db_user = models.User(
email=user.email,
hashed_password=fake_hashed_password,
username=user.username
)
db.add(db_user)
db.commit()


Loading…
Cancel
Save