From 7177cfe9eb53bdedebf5b6810c51aece29a3861f Mon Sep 17 00:00:00 2001 From: Archmonger <16909269+Archmonger@users.noreply.github.com> Date: Thu, 14 Sep 2023 22:59:42 -0700 Subject: [PATCH] fix types --- src/reactpy_django/hooks.py | 3 ++- src/reactpy_django/types.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/reactpy_django/hooks.py b/src/reactpy_django/hooks.py index f74f53d8..8115de56 100644 --- a/src/reactpy_django/hooks.py +++ b/src/reactpy_django/hooks.py @@ -67,7 +67,8 @@ def use_origin() -> str | None: ) return f"{scope['scheme']}://{host}" if host else None except Exception: - return None + _logger.info("Failed to get origin") + return None def use_scope() -> dict[str, Any]: diff --git a/src/reactpy_django/types.py b/src/reactpy_django/types.py index 251efc15..3c77a1eb 100644 --- a/src/reactpy_django/types.py +++ b/src/reactpy_django/types.py @@ -51,7 +51,7 @@ class ComponentWebsocket: dotted_path: str -Connection = _Connection[ComponentWebsocket | HttpRequest] +Connection = _Connection[Union[ComponentWebsocket, HttpRequest]] @dataclass