mirror of
				https://github.com/zulip/zulip.git
				synced 2025-10-31 12:03:46 +00:00 
			
		
		
		
	models: Update can_remove_subscribers_group field to not be null.
This commit udpates can_remove_subscribers_group to be not null. We already added a migration to set the value of this field for existing streams and also added a commit to set this field to admins system group for now while creating streams.
This commit is contained in:
		| @@ -0,0 +1,21 @@ | ||||
| # Generated by Django 4.0.6 on 2022-07-22 14:47 | ||||
|  | ||||
| import django.db.models.deletion | ||||
| from django.db import migrations, models | ||||
|  | ||||
|  | ||||
| class Migration(migrations.Migration): | ||||
|  | ||||
|     dependencies = [ | ||||
|         ("zerver", "0409_set_default_for_can_remove_subscribers_group"), | ||||
|     ] | ||||
|  | ||||
|     operations = [ | ||||
|         migrations.AlterField( | ||||
|             model_name="stream", | ||||
|             name="can_remove_subscribers_group", | ||||
|             field=models.ForeignKey( | ||||
|                 on_delete=django.db.models.deletion.RESTRICT, to="zerver.usergroup" | ||||
|             ), | ||||
|         ), | ||||
|     ] | ||||
| @@ -2511,8 +2511,8 @@ class Stream(models.Model): | ||||
|     # deleting a user group in case it is referenced by this settig. | ||||
|     # We are not using PROTECT since we want to allow deletion of user groups | ||||
|     # when realm itself is deleted. | ||||
|     can_remove_subscribers_group: Optional[UserGroup] = models.ForeignKey( | ||||
|         UserGroup, null=True, on_delete=models.RESTRICT | ||||
|     can_remove_subscribers_group: UserGroup = models.ForeignKey( | ||||
|         UserGroup, on_delete=models.RESTRICT | ||||
|     ) | ||||
|  | ||||
|     # The very first message ID in the stream.  Used to help clients | ||||
|   | ||||
		Reference in New Issue
	
	Block a user