Skip to content

Commit

Permalink
working user creation flow
Browse files Browse the repository at this point in the history
  • Loading branch information
mmiqball committed Oct 26, 2024
1 parent fa2fc6f commit 10bf32c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/app/schemas/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Config:
from_attributes = True

class User(UserBase):
id: str
id: UUID

class Config:
from_attributes = True
Expand Down
4 changes: 2 additions & 2 deletions backend/app/services/implementations/user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def create_user(self, user: UserCreate) -> UserInDB:
all_roles = self.db.query(Role).all()
print("Available roles:", [role.name for role in all_roles])

db_role = self.db.query(Role).filter(Role.name == user.role.value).first()
db_role = self.db.query(Role).filter(Role.name == user.role.name).first()
if not db_role:
raise HTTPException(status_code=400, detail="Invalid role")

Expand All @@ -33,7 +33,7 @@ async def create_user(self, user: UserCreate) -> UserInDB:
first_name=user.first_name,
last_name=user.last_name,
email=user.email,
role=db_role,
role_id=db_role.id,
auth_id=firebase_user.uid
)

Expand Down

0 comments on commit 10bf32c

Please sign in to comment.