mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	realm_logo: Refactor get_realm_logo_url function.
				
					
				
			This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							1da5001875
						
					
				
				
					commit
					7326acdc2b
				
			@@ -9,16 +9,15 @@ def realm_logo_url(realm: Realm, night: bool) -> str:
 | 
				
			|||||||
    return get_realm_logo_url(realm, night)
 | 
					    return get_realm_logo_url(realm, night)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def get_realm_logo_url(realm: Realm, night: bool) -> str:
 | 
					def get_realm_logo_url(realm: Realm, night: bool) -> str:
 | 
				
			||||||
    if not night:
 | 
					    if night:
 | 
				
			||||||
        if realm.logo_source == 'U':
 | 
					        logo_source = realm.night_logo_source
 | 
				
			||||||
            return upload_backend.get_realm_logo_url(realm.id, realm.logo_version, night)
 | 
					        logo_version = realm.night_logo_version
 | 
				
			||||||
        else:
 | 
					 | 
				
			||||||
            return settings.DEFAULT_LOGO_URI+'?version=0'
 | 
					 | 
				
			||||||
    else:
 | 
					    else:
 | 
				
			||||||
        if realm.night_logo_source == 'U':
 | 
					        logo_source = realm.logo_source
 | 
				
			||||||
            return upload_backend.get_realm_logo_url(realm.id, realm.night_logo_version, night)
 | 
					        logo_version = realm.logo_version
 | 
				
			||||||
        else:
 | 
					    if logo_source == 'U':
 | 
				
			||||||
            return settings.DEFAULT_LOGO_URI+'?version=0'
 | 
					        return upload_backend.get_realm_logo_url(realm.id, logo_version, night)
 | 
				
			||||||
 | 
					    return settings.DEFAULT_LOGO_URI+'?version=0'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def get_realm_logo_data(realm: Realm, night: bool) -> Dict[str, Any]:
 | 
					def get_realm_logo_data(realm: Realm, night: bool) -> Dict[str, Any]:
 | 
				
			||||||
    if night:
 | 
					    if night:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user