Skip to content

Commit

Permalink
use TYPE_CHECKING to annotate return type as SocialApp
Browse files Browse the repository at this point in the history
  • Loading branch information
groovecoder committed Apr 23, 2024
1 parent 7473caa commit 06661e9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions privaterelay/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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")

0 comments on commit 06661e9

Please sign in to comment.