From 13dd512f57f2e8acbc996940e5a8557e69842185 Mon Sep 17 00:00:00 2001 From: Rene Dohmen Date: Thu, 24 Oct 2024 12:31:04 +0200 Subject: [PATCH] fixed some 3.9 issues --- pydantic_forms/core/asynchronous.py | 6 +++--- pydantic_forms/core/sync.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pydantic_forms/core/asynchronous.py b/pydantic_forms/core/asynchronous.py index c5b5ae0..40a110e 100644 --- a/pydantic_forms/core/asynchronous.py +++ b/pydantic_forms/core/asynchronous.py @@ -36,7 +36,7 @@ async def generate_form( state: State, user_inputs: list[State], locale: str = "en_US", - extra_translations: dict | None = None, + extra_translations: Union[dict[str, str], None] = None, ) -> Union[State, None]: """Generate form using form generator as defined by a form definition.""" try: @@ -55,7 +55,7 @@ async def post_form( state: State, user_inputs: list[State], locale: str = "en_US", - extra_translations: dict | None = None, + extra_translations: Union[dict[str, str], None] = None, ) -> State: """Post user_input based ond serve a new form if the form wizard logic dictates it.""" # there is no form_generator so we return no validated data @@ -120,7 +120,7 @@ async def start_form( user_inputs: Union[list[State], None] = None, user: str = "Just a user", # Todo: check if we need users inside form logic? locale: str = "en_US", - extra_translations: dict | None = None, + extra_translations: Union[dict[str, str], None] = None, **extra_state: Any, ) -> State: """Handle the logic for the endpoint that the frontend uses to render a form with or without prefilled input. diff --git a/pydantic_forms/core/sync.py b/pydantic_forms/core/sync.py index 6e9cbe1..162a5c1 100644 --- a/pydantic_forms/core/sync.py +++ b/pydantic_forms/core/sync.py @@ -31,7 +31,7 @@ def generate_form( state: State, user_inputs: list[State], lang: str = "en_US", - extra_translations: dict | None = None, + extra_translations: Union[dict[str, str], None] = None, ) -> Union[State, None]: """Generate form using form generator as defined by a form definition.""" try: @@ -50,7 +50,7 @@ def post_form( state: State, user_inputs: list[State], locale: str = "en_US", - extra_translations: dict | None = None, + extra_translations: Union[dict[str, str], None] = None, ) -> State: """Post user_input based ond serve a new form if the form wizard logic dictates it.""" # there is no form_generator so we return no validated data @@ -112,7 +112,7 @@ def start_form( user_inputs: Union[list[State], None] = None, user: str = "Just a user", # Todo: check if we need users inside form logic? locale: str = "en_US", - extra_translations: dict | None = None, + extra_translations: Union[dict[str, str], None] = None, **extra_state: dict[str, Any], ) -> State: """Handle the logic for the endpoint that the frontend uses to render a form with or without prefilled input.