From 06661e9fe9d846482564d2ae8c48a1fd1681c87e Mon Sep 17 00:00:00 2001 From: groovecoder Date: Tue, 23 Apr 2024 11:56:00 -0500 Subject: [PATCH] use TYPE_CHECKING to annotate return type as SocialApp --- privaterelay/apps.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/privaterelay/apps.py b/privaterelay/apps.py index 63c6bbdb96..18f9381e4f 100644 --- a/privaterelay/apps.py +++ b/privaterelay/apps.py @@ -2,7 +2,7 @@ import json import os from pathlib import Path -from typing import Any +from typing import TYPE_CHECKING, Any from django.apps import AppConfig from django.conf import settings @@ -13,6 +13,10 @@ ROOT_DIR = os.path.abspath(os.curdir) +if TYPE_CHECKING: + from allauth.socialaccount.models import SocialApp + + def get_profiler_startup_data() -> tuple[str | None, str | None]: from .utils import get_version_info @@ -96,7 +100,7 @@ def fxa_verifying_keys(self) -> list[dict[str, Any]]: return [] @cached_property - def fxa_social_app(self) -> Any: + def fxa_social_app(self) -> "SocialApp": from allauth.socialaccount.models import SocialApp return SocialApp.objects.get(provider="fxa")