Skip to content

Commit 0f204cd

Browse files
fix httpurl field
1 parent 25d2735 commit 0f204cd

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

packages/common-library/src/common_library/pydantic_networks_extension.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Annotated, TypeAlias
22

3-
from pydantic import AfterValidator, AnyHttpUrl
3+
from pydantic import AfterValidator, AnyHttpUrl, HttpUrl
44

55

66
def _strip_last_slash(url: str) -> str:
@@ -10,3 +10,6 @@ def _strip_last_slash(url: str) -> str:
1010
AnyHttpUrlLegacy: TypeAlias = Annotated[
1111
str, AnyHttpUrl, AfterValidator(_strip_last_slash)
1212
]
13+
14+
15+
HttpUrlLegacy: TypeAlias = Annotated[str, HttpUrl, AfterValidator(_strip_last_slash)]

services/payments/src/simcore_service_payments/core/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from functools import cached_property
22

3+
from common_library.pydantic_networks_extension import HttpUrlLegacy
34
from models_library.basic_types import NonNegativeDecimal
45
from pydantic import (
56
AliasChoices,
67
EmailStr,
78
Field,
8-
HttpUrl,
99
PositiveFloat,
1010
SecretStr,
1111
TypeAdapter,
@@ -65,7 +65,7 @@ class ApplicationSettings(_BaseApplicationSettings):
6565
These settings includes extra configuration for the http-API
6666
"""
6767

68-
PAYMENTS_GATEWAY_URL: HttpUrl = Field(
68+
PAYMENTS_GATEWAY_URL: HttpUrlLegacy = Field(
6969
..., description="Base url to the payment gateway"
7070
)
7171

@@ -125,7 +125,7 @@ class ApplicationSettings(_BaseApplicationSettings):
125125
json_schema_extra={"auto_default_from_env": True},
126126
)
127127

128-
PAYMENTS_STRIPE_URL: HttpUrl = Field(
128+
PAYMENTS_STRIPE_URL: HttpUrlLegacy = Field(
129129
..., description="Base url to the payment Stripe"
130130
)
131131
PAYMENTS_STRIPE_API_SECRET: SecretStr = Field(

services/payments/src/simcore_service_payments/services/payments_gateway.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
from contextlib import suppress
1313

1414
import httpx
15+
from common_library.errors_classes import OsparcErrorMixin
1516
from fastapi import FastAPI
1617
from fastapi.encoders import jsonable_encoder
1718
from httpx import URL, HTTPStatusError
1819
from models_library.api_schemas_webserver.wallets import PaymentID, PaymentMethodID
19-
from models_library.error_classes import OsparcErrorMixin
2020
from pydantic import TypeAdapter, ValidationError
2121
from servicelib.fastapi.app_state import SingletonInAppStateMixin
2222
from servicelib.fastapi.http_client import (

0 commit comments

Comments
 (0)