mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
models: Fix return type of get_realm_domains.
The correct return type of get_realm_domains should be List[Dict[str, Union[bool, str]]] instead of List[Dict[str, str]] because allowed_subdomains is a bool field not str.
This commit is contained in:
@@ -30,6 +30,7 @@ class Command(ZulipBaseCommand):
|
|||||||
if options["op"] == "show":
|
if options["op"] == "show":
|
||||||
print(f"Domains for {realm.string_id}:")
|
print(f"Domains for {realm.string_id}:")
|
||||||
for realm_domain in get_realm_domains(realm):
|
for realm_domain in get_realm_domains(realm):
|
||||||
|
assert isinstance(realm_domain["domain"], str)
|
||||||
if realm_domain["allow_subdomains"]:
|
if realm_domain["allow_subdomains"]:
|
||||||
print(realm_domain["domain"] + " (subdomains allowed)")
|
print(realm_domain["domain"] + " (subdomains allowed)")
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1049,7 +1049,7 @@ class EmailContainsPlusError(Exception):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
def get_realm_domains(realm: Realm) -> List[Dict[str, str]]:
|
def get_realm_domains(realm: Realm) -> List[Dict[str, Union[str, bool]]]:
|
||||||
return list(realm.realmdomain_set.values("domain", "allow_subdomains"))
|
return list(realm.realmdomain_set.values("domain", "allow_subdomains"))
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user