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:
Sahil Batra
2023-04-26 15:43:23 +05:30
committed by Tim Abbott
parent 2f4775ba68
commit 850e0046eb
2 changed files with 4 additions and 4 deletions

View File

@@ -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()],