Skip to content
Snippets Groups Projects
Commit 3ba810bf authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch '1015-fix-migration-error' into 'develop'

Fix #1015: broken migration on S3

Closes #1015

See merge request funkwhale/funkwhale!1007
parents b48a4cd0 f791ba56
No related branches found
No related tags found
No related merge requests found
......@@ -19,13 +19,13 @@ def create_attachments(apps, schema_editor):
print('Creating attachments for {} user avatars, this may take a while…'.format(total))
from django.core.files.storage import FileSystemStorage
for i, user in enumerate(qs):
size = None
if isinstance(user.avatar.storage._wrapped, FileSystemStorage):
try:
size = user.avatar.size
except FileNotFoundError:
# can occur when file isn't found on disk or S3
print(" Warning: avatar file wasn't found in storage: {}".format(e.__class__))
size = None
obj_attachment_mapping[user.actor] = Attachment(
file=user.avatar,
size=size,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment