mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
import: Fix sending floats to boto S3 metadata keys.
The boto library's s3 interface allows setting only string-format metadata keys. So we need to cast the last_modified floating-point timestamp into a string before storing on the S3 object. This bug mostly broke uploading avatars when using the S3 storage backend.
This commit is contained in:
@@ -594,7 +594,7 @@ def import_uploads(import_dir: Path, processing_avatars: bool=False,
|
||||
key.set_metadata("user_profile_id", str(user_profile.id))
|
||||
|
||||
if 'last_modified' in record:
|
||||
key.set_metadata("orig_last_modified", record['last_modified'])
|
||||
key.set_metadata("orig_last_modified", str(record['last_modified']))
|
||||
key.set_metadata("realm_id", str(record['realm_id']))
|
||||
|
||||
# Zulip exports will always have a content-type, but third-party exports might not.
|
||||
|
||||
Reference in New Issue
Block a user