File tree Expand file tree Collapse file tree 6 files changed +12
-10
lines changed
services/web/server/src/simcore_service_webserver Expand file tree Collapse file tree 6 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def create_param_node_from_iterator_with_outputs(iterator_node: Node) -> Node:
3737 label = iterator_node .label ,
3838 inputs = {},
3939 inputNodes = [],
40- thumbnail = "" , # type: ignore[arg-type] # NOTE: hack due to issue in projects json-schema
40+ thumbnail = "" , # NOTE: hack due to issue in projects json-schema
4141 outputs = deepcopy (iterator_node .outputs ),
4242 )
4343
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ async def load_products_on_startup(app: web.Application):
9090 app_products [name ] = Product (
9191 ** dict (row .items ()),
9292 is_payment_enabled = payments .enabled ,
93- credits_per_usd = payments .credits_per_usd , # type: ignore[arg-type]
93+ credits_per_usd = payments .credits_per_usd ,
9494 )
9595
9696 assert name in FRONTEND_APPS_AVAILABLE # nosec
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ async def _get_current_product_price(request: web.Request):
4141
4242 credit_price = GetCreditPrice (
4343 product_name = req_ctx .product_name ,
44- usd_per_credit = price_info .usd_per_credit if price_info else None , # type: ignore[arg-type]
44+ usd_per_credit = price_info .usd_per_credit if price_info else None ,
4545 min_payment_amount_usd = price_info .min_payment_amount_usd # type: ignore[arg-type]
4646 if price_info
4747 else None ,
Original file line number Diff line number Diff line change 66import logging
77
88from aiohttp import web
9+ from common_library .errors_classes import OsparcErrorMixin
910from models_library .api_schemas_webserver .resource_usage import PricingUnitGet
1011from models_library .projects import ProjectID
1112from models_library .projects_nodes_io import NodeID , NodeIDStr
1213from models_library .resource_tracker import PricingPlanId , PricingUnitId
1314from pydantic import BaseModel , ConfigDict
14- from pydantic .errors import PydanticErrorMixin
1515from servicelib .aiohttp .requests_validation import parse_request_path_parameters_as
1616from servicelib .aiohttp .typing_extension import Handler
1717
2929_logger = logging .getLogger (__name__ )
3030
3131
32- class PricingUnitError (PydanticErrorMixin , ValueError ):
32+ class PricingUnitError (OsparcErrorMixin , ValueError ):
3333 ...
3434
3535
@@ -132,7 +132,7 @@ async def connect_pricing_unit_to_project_node(request: web.Request):
132132 path_params .pricing_unit_id ,
133133 )
134134 if rut_pricing_unit .pricing_unit_id != path_params .pricing_unit_id :
135- raise PricingUnitNotFoundError
135+ raise PricingUnitNotFoundError ()
136136
137137 await db .connect_pricing_unit_to_project_node (
138138 path_params .project_id ,
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class WebSocketMessageBase(BaseModel):
2020
2121 @classmethod
2222 def get_event_type (cls ) -> str :
23- _event_type : str = cls .__fields__ ["event_type" ].default
23+ _event_type : str = cls .model_fields ["event_type" ].default
2424 return _event_type
2525
2626 @abstractmethod
Original file line number Diff line number Diff line change 11import re
22from datetime import datetime
3+ from typing import Annotated , TypeAlias
34
45from models_library .api_schemas_webserver ._base import InputSchema , OutputSchema
56from models_library .users import GroupID , UserID
6- from pydantic import ConstrainedStr , Field , PositiveInt
7+ from pydantic import Field , PositiveInt , StringConstraints
78from servicelib .aiohttp .requests_validation import RequestParams , StrictRequestParams
89from servicelib .request_keys import RQT_USERID_KEY
910from simcore_postgres_database .utils_tags import TagDict
@@ -17,8 +18,9 @@ class TagPathParams(StrictRequestParams):
1718 tag_id : PositiveInt
1819
1920
20- class ColorStr (ConstrainedStr ):
21- regex = re .compile (r"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$" )
21+ ColorStr : TypeAlias = Annotated [
22+ str , StringConstraints (pattern = re .compile (r"^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$" ))
23+ ]
2224
2325
2426class TagUpdate (InputSchema ):
You can’t perform that action at this time.
0 commit comments