mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	python: Reformat with Black, except quotes.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							5028c081cb
						
					
				
				
					commit
					11741543da
				
			@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user