File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
packages/models-library/src/models_library/api_schemas_webserver Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1616 ValidationInfo ,
1717 field_validator ,
1818)
19+ from simcore_postgres_database .utils_users import MIN_USERNAME_LEN
1920
2021from ..basic_types import IDStr
2122from ..emails import LowerCaseEmailStr
4647
4748
4849class MyProfilePrivacyGet (OutputSchema ):
50+ hide_username : bool
4951 hide_fullname : bool
5052 hide_email : bool
5153
5254
5355class 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(
141148class 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
You can’t perform that action at this time.
0 commit comments