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 UserProfile field for custom email notifs batching periods.

Abhijeet Prasad Bodasd5d3f14eeeed
diff --git a/zerver/migrations/0334_email_notifications_batching_period.py b/zerver/migrations/0334_email_notifications_batching_period.py
new file mode 100644
index 00000000000..2aeb19b05dc
--- /dev/null
+++ b/zerver/migrations/0334_email_notifications_batching_period.py
@@ -0,0 +1,23 @@
+# Generated by Django 3.2.5 on 2021-07-19 11:00
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ("zerver", "0333_alter_realm_org_type"),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name="realmuserdefault",
+ name="email_notifications_batching_period_seconds",
+ field=models.IntegerField(default=120),
+ ),
+ migrations.AddField(
+ model_name="userprofile",
+ name="email_notifications_batching_period_seconds",
+ field=models.IntegerField(default=120),
+ ),
+ ]
diff --git a/zerver/models.py b/zerver/models.py
index 80989efd2da..759071f7412 100644
--- a/zerver/models.py
+++ b/zerver/models.py
@@ -1299,6 +1299,8 @@ class UserBaseSettings(models.Model):
### Notifications settings. ###
+ email_notifications_batching_period_seconds: int = models.IntegerField(default=120)
+
# Stream notifications.
enable_stream_desktop_notifications: bool = models.BooleanField(default=False)
enable_stream_email_notifications: bool = models.BooleanField(default=False)
@@ -1350,6 +1352,7 @@ class UserBaseSettings(models.Model):
enable_digest_emails=bool,
enable_login_emails=bool,
enable_marketing_emails=bool,
+ email_notifications_batching_period_seconds=int,
enable_offline_email_notifications=bool,
enable_offline_push_notifications=bool,
enable_online_push_notifications=bool,