mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	settings: Rename MAX_ICON_FILE_SIZE.
Rename MAX_ICON_FILE_SIZE to MAX_ICON_FILE_SIZE_MIB reflecting size in mebibytes.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							0f6bb210a6
						
					
				
				
					commit
					2ddc62e9b3
				
			@@ -19,10 +19,10 @@ def upload_icon(request: HttpRequest, user_profile: UserProfile) -> HttpResponse
 | 
			
		||||
        return json_error(_("You must upload exactly one icon."))
 | 
			
		||||
 | 
			
		||||
    icon_file = list(request.FILES.values())[0]
 | 
			
		||||
    if (settings.MAX_ICON_FILE_SIZE * 1024 * 1024) < icon_file.size:
 | 
			
		||||
    if (settings.MAX_ICON_FILE_SIZE_MIB * 1024 * 1024) < icon_file.size:
 | 
			
		||||
        return json_error(
 | 
			
		||||
            _("Uploaded file is larger than the allowed limit of {} MiB").format(
 | 
			
		||||
                settings.MAX_ICON_FILE_SIZE,
 | 
			
		||||
                settings.MAX_ICON_FILE_SIZE_MIB,
 | 
			
		||||
            )
 | 
			
		||||
        )
 | 
			
		||||
    upload_icon_image(icon_file, user_profile)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user