mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	typing: Apply trivial none-checks with assertions as necessary.
Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							58e95cbfae
						
					
				
				
					commit
					fd9a0f4274
				
			@@ -6,6 +6,7 @@ from django.conf import settings
 | 
			
		||||
 | 
			
		||||
def generate_camo_url(url: str) -> str:
 | 
			
		||||
    encoded_url = url.encode()
 | 
			
		||||
    assert settings.CAMO_KEY is not None
 | 
			
		||||
    encoded_camo_key = settings.CAMO_KEY.encode()
 | 
			
		||||
    digest = hmac.new(encoded_camo_key, encoded_url, hashlib.sha1).hexdigest()
 | 
			
		||||
    return f"{digest}/{encoded_url.hex()}"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user