mirror of https://github.com/zulip/zulip.git
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:
parent
bf14a0af4d
commit
02d55928ea
|
@ -616,7 +616,12 @@ def import_uploads(import_dir: Path, processes: int, processing_avatars: bool=Fa
|
|||
if record['s3_path'].endswith('.original'):
|
||||
relative_path += '.original'
|
||||
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:
|
||||
# For emojis we follow the function 'upload_emoji_image'
|
||||
relative_path = RealmEmoji.PATH_ID_TEMPLATE.format(
|
||||
|
|
Loading…
Reference in New Issue