Skip to content

Commit

Permalink
refactor: simplify success_url and failure_url type hints in Session …
Browse files Browse the repository at this point in the history
…class
  • Loading branch information
gabino committed Jan 9, 2025
1 parent 1712d33 commit f295c73
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cuenca/resources/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import ClassVar, Optional, cast

from cuenca_validations.types import AnyUrlString, SessionRequest, SessionType
from pydantic import AnyUrl, ConfigDict
from pydantic import ConfigDict

from .. import http
from .base import Creatable, Queryable, Retrievable
Expand Down Expand Up @@ -39,16 +39,16 @@ def create(
cls,
user_id: str,
type: SessionType,
success_url=cast(Optional[AnyUrl], success_url),
failure_url=cast(Optional[AnyUrl], failure_url),
success_url: Optional[str] = None,
failure_url: Optional[str] = None,
*,
session: http.Session = http.session,
) -> 'Session':
req = SessionRequest(
user_id=user_id,
type=type,
success_url=success_url,
failure_url=failure_url,
success_url=success_url, # type: ignore
failure_url=failure_url, # type: ignore
)
return cast(
'Session', cls._create(session=session, **req.model_dump())
Expand Down

0 comments on commit f295c73

Please sign in to comment.