python: Reformat with Black, except quotes.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-02-11 23:19:30 -08:00
committed by Tim Abbott
parent 5028c081cb
commit 11741543da
817 changed files with 44952 additions and 24860 deletions

View File

@@ -8,17 +8,23 @@ from django.db.models import Case, Value, When
def set_initial_value_for_is_muted(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
Subscription = apps.get_model("zerver", "Subscription")
Subscription.objects.update(is_muted=Case(
When(in_home_view=True, then=Value(False)),
When(in_home_view=False, then=Value(True)),
))
Subscription.objects.update(
is_muted=Case(
When(in_home_view=True, then=Value(False)),
When(in_home_view=False, then=Value(True)),
)
)
def reverse_code(apps: StateApps, schema_editor: DatabaseSchemaEditor) -> None:
Subscription = apps.get_model("zerver", "Subscription")
Subscription.objects.update(in_home_view=Case(
When(is_muted=True, then=Value(False)),
When(is_muted=False, then=Value(True)),
))
Subscription.objects.update(
in_home_view=Case(
When(is_muted=True, then=Value(False)),
When(is_muted=False, then=Value(True)),
)
)
class Migration(migrations.Migration):
atomic = False