mirror of
https://github.com/zulip/zulip.git
synced 2025-10-29 11:03:54 +00:00
This commit migrates the Subscription's notification fields from a BooleanField to a NullBooleanField where a value of None means to inherit the value from user's profile. Also includes a migrations to set the corresponding settings to None if they match the user profile's values. This migration helps us in getting rid of the weird "Apply to all" widget that we offered on subscription settings page. The mobile apps can't handle None appearing as the stream-level notification settings, so for backwards-compatibility we arrange to only send True/False to the mobile apps by applying those defaults server-side. We introduce a notification_settings_null value within a client_capabilities structure that newer versions of the mobile apps can use to request the new model. This mobile compatibility code is pretty effectively tested by the existing test_events tests for the subscriptions subsystem.
35 lines
1.0 KiB
Python
35 lines
1.0 KiB
Python
# -*- coding: utf-8 -*-
|
|
# Generated by Django 1.11.18 on 2019-02-12 17:41
|
|
from __future__ import unicode_literals
|
|
|
|
from django.db import migrations, models
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
('zerver', '0219_toggle_realm_digest_emails_enabled_default'),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AlterField(
|
|
model_name='subscription',
|
|
name='audible_notifications',
|
|
field=models.NullBooleanField(default=None),
|
|
),
|
|
migrations.AlterField(
|
|
model_name='subscription',
|
|
name='desktop_notifications',
|
|
field=models.NullBooleanField(default=None),
|
|
),
|
|
migrations.AlterField(
|
|
model_name='subscription',
|
|
name='email_notifications',
|
|
field=models.NullBooleanField(default=None),
|
|
),
|
|
migrations.AlterField(
|
|
model_name='subscription',
|
|
name='push_notifications',
|
|
field=models.NullBooleanField(default=None),
|
|
),
|
|
]
|