Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
models: Create OrgTypeDict for Realm.ORG_TYPES typing.
Mateusz Manderae276812e42f8
diff --git a/zerver/models.py b/zerver/models.pyindex da117fbab71..4392246ba0b 100644--- a/zerver/models.py+++ b/zerver/models.py@@ -295,6 +295,14 @@ def generate_realm_uuid_owner_secret() -> str:return f"zuliprealm_{token}"+class OrgTypeDict(TypedDict):+ name: str+ id: int+ hidden: bool+ display_order: int+ onboarding_zulip_guide_url: Optional[str]++class Realm(models.Model): # type: ignore[django-manager-missing] # django-stubs cannot resolve the custom CTEManager yet https://github.com/typeddjango/django-stubs/issues/1023MAX_REALM_NAME_LENGTH = 40MAX_REALM_DESCRIPTION_LENGTH = 1000@@ -554,7 +562,7 @@ class Realm(models.Model): # type: ignore[django-manager-missing] # django-stubfirst_visible_message_id = models.IntegerField(default=0)# Valid org types- ORG_TYPES: Dict[str, Dict[str, Any]] = {+ ORG_TYPES: Dict[str, OrgTypeDict] = {"unspecified": {"name": "Unspecified","id": 0,