mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 11:01:12 +00:00
export avatars to own directory
Saving avatars to /images is problematic because it changes the original filepath from avatars/filename to images/avatars/filename. In this PR prior to this commit, imports failed as they are looking for a file path beginning with "avatar"
This commit is contained in:
parent
5d597f1ca9
commit
501fb45528
1 changed files with 3 additions and 5 deletions
|
@ -139,9 +139,7 @@ def create_archive_task(job_id):
|
|||
images_storage = storage_backends.ImagesStorage()
|
||||
|
||||
if user.avatar:
|
||||
add_file_to_s3_tar(
|
||||
s3_tar, images_storage, user.avatar, directory="images"
|
||||
)
|
||||
add_file_to_s3_tar(s3_tar, images_storage, user.avatar)
|
||||
|
||||
for edition in editions:
|
||||
if edition.cover:
|
||||
|
@ -166,7 +164,7 @@ def create_archive_task(job_id):
|
|||
|
||||
# Add avatar image if present
|
||||
if user.avatar:
|
||||
tar.add_image(user.avatar, directory="images")
|
||||
tar.add_image(user.avatar)
|
||||
|
||||
for edition in editions:
|
||||
if edition.cover:
|
||||
|
@ -196,7 +194,7 @@ def export_user(user: User):
|
|||
"""export user data"""
|
||||
data = user.to_activity()
|
||||
if user.avatar:
|
||||
data["icon"]["url"] = archive_file_location(user.avatar, directory="images")
|
||||
data["icon"]["url"] = archive_file_location(user.avatar)
|
||||
else:
|
||||
data["icon"] = {}
|
||||
return data
|
||||
|
|
Loading…
Reference in a new issue