models: Delete unused Subscription.notifications field.

This deletes the unused Subscription.notifications field and removes
it from some testing and analytics code (which should not have been
using it in the first place).

Fixes #10042.
This commit is contained in:
Roman Godov 2018-07-27 00:06:22 +03:00 committed by Tim Abbott
parent 064fca5b76
commit 34ae3dfd44
3 changed files with 20 additions and 5 deletions

View File

@ -145,7 +145,7 @@ class Command(BaseCommand):
len(markup_messages), sum([elt["count"] for elt in markup_messages]))) len(markup_messages), sum([elt["count"] for elt in markup_messages])))
# Notifications for stream messages # Notifications for stream messages
notifications = active_user_subs.filter(notifications=True).values( notifications = active_user_subs.filter(desktop_notifications=True).values(
"user_profile").annotate(count=Count("user_profile")) "user_profile").annotate(count=Count("user_profile"))
print("%d users receive desktop notifications for %d streams" % ( print("%d users receive desktop notifications for %d streams" % (
len(notifications), sum([elt["count"] for elt in notifications]))) len(notifications), sum([elt["count"] for elt in notifications])))

View File

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-26 18:38
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('zerver', '0175_change_realm_audit_log_event_type_tense'),
]
operations = [
migrations.RemoveField(
model_name='subscription',
name='notifications',
),
]

View File

@ -1692,10 +1692,6 @@ class Subscription(models.Model):
push_notifications = models.BooleanField(default=False) # type: bool push_notifications = models.BooleanField(default=False) # type: bool
email_notifications = models.BooleanField(default=False) # type: bool email_notifications = models.BooleanField(default=False) # type: bool
# Combination desktop + audible notifications superseded by the
# above.
notifications = models.BooleanField(default=False) # type: bool
class Meta: class Meta:
unique_together = ("user_profile", "recipient") unique_together = ("user_profile", "recipient")