Skip to content

Commit

Permalink
fix: user roles in user profile
Browse files Browse the repository at this point in the history
  • Loading branch information
nrjadkry committed Jul 10, 2024
1 parent a632da2 commit 7bfb271
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/backend/app/users/user_schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,10 @@ class ProfileUpdate(BaseModel):
drone_you_own: Optional[str] = None
experience_years: Optional[int] = None
certified_drone_operator: Optional[bool] = False
role: Optional[UserRole] = UserRole.DRONE_PILOT.name
role: Optional[UserRole] = UserRole.DRONE_PILOT
password: Optional[str] = None

@field_validator("role", mode="after")
@classmethod
def integer_role_to_string(cls, value: UserRole) -> str:
return str(value.name)

0 comments on commit 7bfb271

Please sign in to comment.