2014-02-14 16:36:20 +01:00
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2016-06-04 16:52:18 +02:00
|
|
|
from typing import Any
|
|
|
|
|
2014-02-14 16:36:20 +01:00
|
|
|
from django.core.management.base import BaseCommand
|
|
|
|
from zerver.models import Subscription
|
|
|
|
|
|
|
|
class Command(BaseCommand):
|
|
|
|
help = """One-off script to migration users' stream notification settings."""
|
|
|
|
|
|
|
|
def handle(self, *args, **options):
|
2016-06-04 16:52:18 +02:00
|
|
|
# type: (*Any, **Any) -> None
|
2014-02-14 16:36:20 +01:00
|
|
|
for subscription in Subscription.objects.all():
|
|
|
|
subscription.desktop_notifications = subscription.notifications
|
|
|
|
subscription.audible_notifications = subscription.notifications
|
|
|
|
subscription.save(update_fields=["desktop_notifications",
|
|
|
|
"audible_notifications"])
|