mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
models: Add ORG_TYPE_IDS constant field to Realm.
This commit adds ORG_TYPE_IDS constant field to Realm class such that it can be used when we want to validate the org_type passed in request. This was previously defined in realm.py, but we move it inside Realm class such that we can use it at other places as well.
This commit is contained in:
@@ -623,6 +623,8 @@ class Realm(models.Model): # type: ignore[django-manager-missing] # django-stub
|
||||
},
|
||||
}
|
||||
|
||||
ORG_TYPE_IDS: List[int] = [t["id"] for t in ORG_TYPES.values()]
|
||||
|
||||
org_type = models.PositiveSmallIntegerField(
|
||||
default=ORG_TYPES["unspecified"]["id"],
|
||||
choices=[(t["id"], t["name"]) for t in ORG_TYPES.values()],
|
||||
|
||||
Reference in New Issue
Block a user