Skip to content

Commit 4ba3d20

Browse files
committed
fixes test
1 parent 838783e commit 4ba3d20

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

services/web/server/src/simcore_service_webserver/login/_confirmation_repository.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ async def create_confirmation(
4242
data: str | None = None,
4343
) -> Confirmation:
4444
"""Create a new confirmation token for a user action."""
45+
4546
async with transaction_context(self.engine, connection) as conn:
46-
# Generate unique code
47-
while True:
47+
# We want the same connection checking uniqueness and inserting
48+
while True: # Generate unique code
49+
4850
# NOTE: use only numbers since front-end does not handle well url encoding
4951
numeric_code: str = generate_passcode(20)
5052

services/web/server/src/simcore_service_webserver/products/_models.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,20 +70,21 @@ class Product(BaseModel):
7070
Field(pattern=PUBLIC_VARIABLE_NAME_RE, validate_default=True),
7171
]
7272

73-
display_name: Annotated[str, Field(..., description="Long display name")]
73+
display_name: Annotated[str, Field(description="Long display name")]
7474
short_name: Annotated[
7575
str | None,
7676
Field(
77-
None,
7877
pattern=re.compile(TWILIO_ALPHANUMERIC_SENDER_ID_RE),
7978
min_length=2,
8079
max_length=11,
8180
description="Short display name for SMS",
8281
),
83-
]
82+
] = None
8483

8584
host_regex: Annotated[
86-
re.Pattern, BeforeValidator(str.strip), Field(..., description="Host regex")
85+
re.Pattern,
86+
BeforeValidator(lambda s: s.strip() if isinstance(s, str) else s),
87+
Field(description="Host regex"),
8788
]
8889

8990
support_email: Annotated[
@@ -115,7 +116,7 @@ class Product(BaseModel):
115116

116117
manuals: list[Manual] | None = None
117118

118-
support: list[Forum | EmailFeedback | WebFeedback] | None = Field(None)
119+
support: list[Forum | EmailFeedback | WebFeedback] | None = None
119120

120121
login_settings: Annotated[
121122
ProductLoginSettingsDict,
@@ -153,9 +154,7 @@ class Product(BaseModel):
153154

154155
is_payment_enabled: Annotated[
155156
bool,
156-
Field(
157-
description="True if this product offers credits",
158-
),
157+
Field(description="True if this product offers credits"),
159158
] = False
160159

161160
credits_per_usd: Annotated[

0 commit comments

Comments
 (0)