mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
models: Make realm.name no longer nullable.
This was likely initiall created with null=True in
5c5ffd6ea3 just because we didn't have a
plan for backfilling this field, but I verified that Zulip Cloud has
no realms without a name set, and that's the place most likely to have
any form of super-legacy nameless realms.
So we can clean up this aspect of the data model without a special
migration to do something with existing realms with name=None (which I
suspect would have resulted in a 500 anyway).
This commit is contained in:
18
zerver/migrations/0345_alter_realm_name.py
Normal file
18
zerver/migrations/0345_alter_realm_name.py
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 3.2.6 on 2021-09-08 22:35
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
("zerver", "0344_alter_emojiset_default_value"),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name="realm",
|
||||||
|
name="name",
|
||||||
|
field=models.CharField(max_length=40),
|
||||||
|
),
|
||||||
|
]
|
||||||
@@ -207,7 +207,7 @@ class Realm(models.Model):
|
|||||||
id: int = models.AutoField(auto_created=True, primary_key=True, verbose_name="ID")
|
id: int = models.AutoField(auto_created=True, primary_key=True, verbose_name="ID")
|
||||||
|
|
||||||
# User-visible display name and description used on e.g. the organization homepage
|
# User-visible display name and description used on e.g. the organization homepage
|
||||||
name: Optional[str] = models.CharField(max_length=MAX_REALM_NAME_LENGTH, null=True)
|
name: str = models.CharField(max_length=MAX_REALM_NAME_LENGTH)
|
||||||
description: str = models.TextField(default="")
|
description: str = models.TextField(default="")
|
||||||
|
|
||||||
# A short, identifier-like name for the organization. Used in subdomains;
|
# A short, identifier-like name for the organization. Used in subdomains;
|
||||||
|
|||||||
Reference in New Issue
Block a user