typing: Import StrPromise alias from django_stubs_ext.

This saves us from using a conditional import.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li
2022-09-19 15:43:34 -04:00
committed by Tim Abbott
parent df18bbbd48
commit a4eaa770f0
6 changed files with 23 additions and 45 deletions

View File

@@ -1,16 +1,14 @@
# See https://zulip.readthedocs.io/en/latest/subsystems/hotspots.html
# for documentation on this subsystem.
from typing import TYPE_CHECKING, Dict, List
from typing import Dict, List
from django.conf import settings
from django.utils.translation import gettext_lazy
from django_stubs_ext import StrPromise
from zerver.models import UserHotspot, UserProfile
if TYPE_CHECKING:
from django.utils.functional import _StrPromise as StrPromise
INTRO_HOTSPOTS: Dict[str, Dict[str, "StrPromise"]] = {
INTRO_HOTSPOTS: Dict[str, Dict[str, StrPromise]] = {
"intro_streams": {
"title": gettext_lazy("Catch up on a stream"),
"description": gettext_lazy(
@@ -44,7 +42,7 @@ INTRO_HOTSPOTS: Dict[str, Dict[str, "StrPromise"]] = {
# We would most likely implement new hotspots in the future that aren't
# a part of the initial tutorial. To that end, classifying them into
# categories which are aggregated in ALL_HOTSPOTS, seems like a good start.
ALL_HOTSPOTS: Dict[str, Dict[str, "StrPromise"]] = {
ALL_HOTSPOTS: Dict[str, Dict[str, StrPromise]] = {
**INTRO_HOTSPOTS,
}