mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	import: Fix importing slack avatars into S3_UPLOAD_BACKEND.
Apparently, a subtle mismatch between the filename/URL formats for our upload codebases meant that importing Slack avatars into systems using S3_UPLOAD_BACKEND would end up with the avatars having the wrong URLs.
This commit is contained in:
		@@ -616,7 +616,12 @@ def import_uploads(import_dir: Path, processes: int, processing_avatars: bool=Fa
 | 
				
			|||||||
            if record['s3_path'].endswith('.original'):
 | 
					            if record['s3_path'].endswith('.original'):
 | 
				
			||||||
                relative_path += '.original'
 | 
					                relative_path += '.original'
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                relative_path += '.png'
 | 
					                # TODO: This really should be unconditional.  However,
 | 
				
			||||||
 | 
					                # until we fix the S3 upload backend to use the .png
 | 
				
			||||||
 | 
					                # path suffix for its normal avatar URLs, we need to
 | 
				
			||||||
 | 
					                # only do this for the LOCAL_UPLOADS_DIR backend.
 | 
				
			||||||
 | 
					                if not s3_uploads:
 | 
				
			||||||
 | 
					                    relative_path += '.png'
 | 
				
			||||||
        elif processing_emojis:
 | 
					        elif processing_emojis:
 | 
				
			||||||
            # For emojis we follow the function 'upload_emoji_image'
 | 
					            # For emojis we follow the function 'upload_emoji_image'
 | 
				
			||||||
            relative_path = RealmEmoji.PATH_ID_TEMPLATE.format(
 | 
					            relative_path = RealmEmoji.PATH_ID_TEMPLATE.format(
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user