Skip to content

Commit cfeba42

Browse files
committed
missing fields
1 parent 9810d3f commit cfeba42

File tree

1 file changed

+11
-2
lines changed
  • packages/models-library/src/models_library/api_schemas_webserver

1 file changed

+11
-2
lines changed

packages/models-library/src/models_library/api_schemas_webserver/users.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
ValidationInfo,
1717
field_validator,
1818
)
19+
from simcore_postgres_database.utils_users import MIN_USERNAME_LEN
1920

2021
from ..basic_types import IDStr
2122
from ..emails import LowerCaseEmailStr
@@ -46,11 +47,13 @@
4647

4748

4849
class MyProfilePrivacyGet(OutputSchema):
50+
hide_username: bool
4951
hide_fullname: bool
5052
hide_email: bool
5153

5254

5355
class MyProfilePrivacyPatch(InputSchema):
56+
hide_username: bool | None = None
5457
hide_fullname: bool | None = None
5558
hide_email: bool | None = None
5659

@@ -92,7 +95,11 @@ class MyProfileGet(OutputSchemaWithoutCamelCase):
9295
"role": "admin", # pre
9396
"expirationDate": "2022-09-14", # optional
9497
"preferences": {},
95-
"privacy": {"hide_fullname": 0, "hide_email": 1},
98+
"privacy": {
99+
"hide_username": 0,
100+
"hide_fullname": 0,
101+
"hide_email": 1,
102+
},
96103
},
97104
]
98105
},
@@ -141,7 +148,9 @@ def from_domain_model(
141148
class MyProfilePatch(InputSchemaWithoutCamelCase):
142149
first_name: FirstNameStr | None = None
143150
last_name: LastNameStr | None = None
144-
user_name: Annotated[IDStr | None, Field(alias="userName", min_length=4)] = None
151+
user_name: Annotated[
152+
IDStr | None, Field(alias="userName", min_length=MIN_USERNAME_LEN)
153+
] = None
145154

146155
privacy: MyProfilePrivacyPatch | None = None
147156

0 commit comments

Comments
 (0)