mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 05:23:35 +00:00 
			
		
		
		
	python: Normalize quotes with Black.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							11741543da
						
					
				
				
					commit
					6e4c3e41dc
				
			@@ -13,8 +13,8 @@ from zerver.models import UserProfile, validate_attachment_request
 | 
			
		||||
def validate_thumbnail_request(user_profile: UserProfile, path: str) -> Optional[bool]:
 | 
			
		||||
    # path here does not have a leading / as it is parsed from request hitting the
 | 
			
		||||
    # thumbnail endpoint (defined in urls.py) that way.
 | 
			
		||||
    if path.startswith('user_uploads/'):
 | 
			
		||||
        path_id = path[len('user_uploads/') :]
 | 
			
		||||
    if path.startswith("user_uploads/"):
 | 
			
		||||
        path_id = path[len("user_uploads/") :]
 | 
			
		||||
        return validate_attachment_request(user_profile, path_id)
 | 
			
		||||
 | 
			
		||||
    # This is an external link and we don't enforce restricted view policy here.
 | 
			
		||||
@@ -32,10 +32,10 @@ def backend_serve_thumbnail(
 | 
			
		||||
        return HttpResponseForbidden(_("<p>You are not authorized to view this file.</p>"))
 | 
			
		||||
 | 
			
		||||
    size = None
 | 
			
		||||
    if size_requested == 'thumbnail':
 | 
			
		||||
        size = '0x300'
 | 
			
		||||
    elif size_requested == 'full':
 | 
			
		||||
        size = '0x0'
 | 
			
		||||
    if size_requested == "thumbnail":
 | 
			
		||||
        size = "0x300"
 | 
			
		||||
    elif size_requested == "full":
 | 
			
		||||
        size = "0x0"
 | 
			
		||||
 | 
			
		||||
    if size is None:
 | 
			
		||||
        return HttpResponseForbidden(_("<p>Invalid size.</p>"))
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user