Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception Value: 'FileMetadata' object is not subscriptable with Dropbox backend #714

Closed
math-a3k opened this issue Jun 5, 2019 · 1 comment

Comments

@math-a3k
Copy link
Contributor

math-a3k commented Jun 5, 2019

Using:

Django==2.2.1
django-storages==1.7.1
dropbox==9.3.0
wagtail==2.5.1

After uploading a document, the document is uploaded to Dropbox correctly, but when trying to retrieve the file it shows the following traceback:

Traceback:

File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/core/handlers/exception.py" in inner
  34.             response = get_response(request)

File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  115.                 response = self.process_exception_by_middleware(e, request)

File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/core/handlers/base.py" in _get_response
  113.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/wagtail/documents/views/serve.py" in serve
  70.         response['Content-Length'] = doc.file.size

File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/fields/files.py" in size
  69.         return self.storage.size(self.name)

File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/storages/backends/dropbox.py" in size
  93.         return metadata['bytes']

Exception Type: TypeError at /documents/1/Tips
Exception Value: 'FileMetadata' object is not subscriptable
@jschneier
Copy link
Owner

Fixed by #724.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants