You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After uploading an image, a TypeError is raised (traceback follows). The image gets uploaded to Dropbox, so the problem seems to be when it comes to retrieve the info of the file from Django. The S3 backend works with the same stack, so I guess this is specific to the Dropbox backend.
Internal Server Error: /admin/images/multiple/add/
Traceback (most recent call last):
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
response = get_response(request)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/wagtail/admin/urls/__init__.py", line 102, in wrapper
return view_func(request, *args, **kwargs)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/wagtail/admin/decorators.py", line 34, in decorated_view
return view_func(request, *args, **kwargs)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/wagtail/admin/utils.py", line 151, in wrapped_view_func
return view_func(request, *args, **kwargs)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/views/decorators/vary.py", line 20, in inner_func
response = func(*args, **kwargs)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/wagtail/images/views/multiple.py", line 74, in add
image.save()
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/base.py", line 741, in save
force_update=force_update, update_fields=update_fields)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/base.py", line 779, in save_base
force_update, using, update_fields,
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/base.py", line 870, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/base.py", line 908, in _do_insert
using=using, raw=raw)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/query.py", line 1186, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1334, in execute_sql
for sql, params in self.as_sql():
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1278, in as_sql
for obj in self.query.objs
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1278, in <listcomp>
for obj in self.query.objs
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1277, in <listcomp>
[self.prepare_value(field, self.pre_save_val(field, obj)) for field in fields]
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/sql/compiler.py", line 1228, in pre_save_val
return field.pre_save(obj, add=True)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/fields/files.py", line 288, in pre_save
file.save(file.name, file.file, save=False)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/fields/files.py", line 88, in save
setattr(self.instance, self.field.name, self.name)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/fields/files.py", line 346, in __set__
self.field.update_dimension_fields(instance, force=True)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/db/models/fields/files.py", line 449, in update_dimension_fields
width = file.width
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/core/files/images.py", line 19, in width
return self._get_image_dimensions()[0]
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/core/files/images.py", line 29, in _get_image_dimensions
self._dimensions_cache = get_image_dimensions(self, close=close)
File "/home/bot/code/conuruinca/venv/lib/python3.7/site-packages/django/core/files/images.py", line 47, in get_image_dimensions
file = open(file_or_path, 'rb')
TypeError: expected str, bytes or os.PathLike object, not ImageFieldFile
The text was updated successfully, but these errors were encountered:
math-a3k
changed the title
TypeError: expected str, bytes or os.PathLike object, not ImageFieldFile with Dropbox backend on
TypeError: expected str, bytes or os.PathLike object, not ImageFieldFile with Dropbox backend
Jun 5, 2019
Using:
After uploading an image, a TypeError is raised (traceback follows). The image gets uploaded to Dropbox, so the problem seems to be when it comes to retrieve the info of the file from Django. The S3 backend works with the same stack, so I guess this is specific to the Dropbox backend.
The text was updated successfully, but these errors were encountered: