sts-sponsors team mailing list archive
-
sts-sponsors team
-
Mailing list archive
-
Message #07502
[Merge] ~thorsten-merten/maas-site-manager:fix-users-me-2 into maas-site-manager:main
Thorsten Merten has proposed merging ~thorsten-merten/maas-site-manager:fix-users-me-2 into maas-site-manager:main.
Commit message:
fix: derive UserWithPassword from User to include id
fixes /users/me url
Requested reviews:
Jack Lloyd-Walters (lloydwaltersj)
MAAS Lander (maas-lander)
Alberto Donato (ack)
For more details, see:
https://code.launchpad.net/~thorsten-merten/maas-site-manager/+git/maas-site-manager/+merge/441759
fix: derive UserWithPassword from User to include id
fixes /users/me url
--
Your team MAAS Committers is subscribed to branch ~thorsten-merten/maas-site-manager:fix-users-me-2.
diff --git a/backend/msm/schema/_models.py b/backend/msm/schema/_models.py
index a62e3e6..1362f63 100644
--- a/backend/msm/schema/_models.py
+++ b/backend/msm/schema/_models.py
@@ -29,21 +29,21 @@ class ReadUser(BaseModel):
full_name: str
-class UserWithPassword(ReadUser):
+class User(ReadUser):
"""
- To create a user we need a password as well.
+ To read a user from the DB it comes with an ID
"""
- # use password.get_secret_value() to retrieve the value
- password: SecretStr = Field(min_length=8, max_length=100)
+ id: int
-class User(ReadUser):
+class UserWithPassword(User):
"""
- To read a user from the DB it comes with an ID
+ To create a user we need a password as well.
"""
- id: int
+ # use password.get_secret_value() to retrieve the value
+ password: SecretStr = Field(min_length=8, max_length=100)
class UserLoginRequest(BaseModel):
Follow ups