models: Add UserProfile field for custom email notifs batching periods.

The default is 2 minutes (120 seconds), which was the hardcoded value
earlier.
This commit is contained in:
Abhijeet Prasad Bodas 2021-07-19 14:26:34 +05:30 committed by Tim Abbott
parent 9fcb6e51ce
commit d5d3f14eee
2 changed files with 26 additions and 0 deletions

View File

@ -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),
),
]

View File

@ -1299,6 +1299,8 @@ class UserBaseSettings(models.Model):
### Notifications settings. ### ### Notifications settings. ###
email_notifications_batching_period_seconds: int = models.IntegerField(default=120)
# Stream notifications. # Stream notifications.
enable_stream_desktop_notifications: bool = models.BooleanField(default=False) enable_stream_desktop_notifications: bool = models.BooleanField(default=False)
enable_stream_email_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_digest_emails=bool,
enable_login_emails=bool, enable_login_emails=bool,
enable_marketing_emails=bool, enable_marketing_emails=bool,
email_notifications_batching_period_seconds=int,
enable_offline_email_notifications=bool, enable_offline_email_notifications=bool,
enable_offline_push_notifications=bool, enable_offline_push_notifications=bool,
enable_online_push_notifications=bool, enable_online_push_notifications=bool,