Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

models: Add org_type to RemoteZulipServer.

Aman Agrawal2795f11e3ffe
diff --git a/zilencer/migrations/0041_remotezulipserver_org_type.py b/zilencer/migrations/0041_remotezulipserver_org_type.py
new file mode 100644
index 00000000000..468f7a7efea
--- /dev/null
+++ b/zilencer/migrations/0041_remotezulipserver_org_type.py
@@ -0,0 +1,34 @@
+# Generated by Django 4.2.7 on 2023-11-29 05:16
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("zilencer", "0040_remoterealm_authentication_methods_remoterealm_name"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="remotezulipserver",
+ name="org_type",
+ field=models.PositiveSmallIntegerField(
+ choices=[
+ (0, "Unspecified"),
+ (10, "Business"),
+ (20, "Open-source project"),
+ (30, "Education (non-profit)"),
+ (35, "Education (for-profit)"),
+ (40, "Research"),
+ (50, "Event or conference"),
+ (60, "Non-profit (registered)"),
+ (70, "Government"),
+ (80, "Political group"),
+ (90, "Community"),
+ (100, "Personal"),
+ (1000, "Other"),
+ ],
+ default=0,
+ ),
+ ),
+ ]
diff --git a/zilencer/models.py b/zilencer/models.py
index f4229f53122..d1a24a16135 100644
--- a/zilencer/models.py
+++ b/zilencer/models.py
@@ -58,6 +58,12 @@ class RemoteZulipServer(models.Model):
# The current billing plan for the remote server, similar to Realm.plan_type.
plan_type = models.PositiveSmallIntegerField(default=PLAN_TYPE_SELF_HOSTED)
+ # This is not synced with the remote server, but only filled for sponsorship requests.
+ org_type = models.PositiveSmallIntegerField(
+ default=Realm.ORG_TYPES["unspecified"]["id"],
+ choices=[(t["id"], t["name"]) for t in Realm.ORG_TYPES.values()],
+ )
+
@override
def __str__(self) -> str:
return f"{self.hostname} {str(self.uuid)[0:12]}"