mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 16:14:02 +00:00
models: Add org_type to RemoteZulipServer.
This is required to save sponsorship data for remote servers.
This commit is contained in:
34
zilencer/migrations/0041_remotezulipserver_org_type.py
Normal file
34
zilencer/migrations/0041_remotezulipserver_org_type.py
Normal file
@@ -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,
|
||||
),
|
||||
),
|
||||
]
|
@@ -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]}"
|
||||
|
Reference in New Issue
Block a user