mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
This is a preparatory commit for using isort for sorting all of our imports, merging changes to files where we can easily review the changes as something we're happy with. These are also files with relatively little active development, which means we don't expect much merge conflict risk from these changes.
17 lines
636 B
Python
17 lines
636 B
Python
from typing import Any
|
|
|
|
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: Any, **options: Any) -> None:
|
|
for subscription in Subscription.objects.all():
|
|
subscription.desktop_notifications = subscription.notifications
|
|
subscription.audible_notifications = subscription.notifications
|
|
subscription.save(update_fields=["desktop_notifications",
|
|
"audible_notifications"])
|