From f295c735627063c13f1614d3907d17b58fc6ebc6 Mon Sep 17 00:00:00 2001 From: gabino Date: Wed, 8 Jan 2025 19:06:15 -0600 Subject: [PATCH] refactor: simplify success_url and failure_url type hints in Session class --- cuenca/resources/sessions.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cuenca/resources/sessions.py b/cuenca/resources/sessions.py index eb7f700d..55f3004c 100644 --- a/cuenca/resources/sessions.py +++ b/cuenca/resources/sessions.py @@ -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 @@ -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())