将Wagtail从1.13.1升级到2.2.1,并将Django从1.11.4升级到2.0.3后,我无法上传图像。当我在编辑页面时上传图像,或者在通过侧栏上的图像条目批量上传图像时,会发生这种情况。 Wa尾后端出现500错误,并且此错误:
django.db.utils.IntegrityError: (1048, "Column 'width' cannot be null")
跟踪:
Internal Server Error: /admin/images/multiple/add/
Traceback (most recent call last):
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 71, in execute
return self.cursor.execute(query, args)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/MySQLdb/cursors.py", line 250, in execute
self.errorhandler(self, exc, value)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
raise errorvalue
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/MySQLdb/cursors.py", line 247, in execute
res = self._query(query)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/MySQLdb/cursors.py", line 411, in _query
rowcount = self._do_query(q)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/MySQLdb/cursors.py", line 374, in _do_query
db.query(q)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/MySQLdb/connections.py", line 292, in query
_mysql.connection.query(self, query)
_mysql_exceptions.OperationalError: (1048, "Column 'width' cannot be null")
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/core/handlers/exception.py", line 35, in inner
response = get_response(request)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/core/handlers/base.py", line 128, in _get_response
response = self.process_exception_by_middleware(e, request)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/core/handlers/base.py", line 126, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/views/decorators/cache.py", line 31, in _cache_controlled
response = viewfunc(request, *args, **kw)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/wagtail/admin/urls/__init__.py", line 102, in wrapper
return view_func(request, *args, **kwargs)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/wagtail/admin/decorators.py", line 34, in decorated_view
return view_func(request, *args, **kwargs)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/wagtail/admin/utils.py", line 145, in wrapped_view_func
return view_func(request, *args, **kwargs)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/views/decorators/vary.py", line 20, in inner_func
response = func(*args, **kwargs)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/wagtail/images/views/multiple.py", line 72, in add
image.save()
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/db/models/base.py", line 729, in save
force_update=force_update, update_fields=update_fields)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/db/models/base.py", line 759, in save_base
updated = self._save_table(raw, cls, force_insert, force_update, using, update_fields)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/db/models/base.py", line 842, in _save_table
result = self._do_insert(cls._base_manager, using, fields, update_pk, raw)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/db/models/base.py", line 880, in _do_insert
using=using, raw=raw)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/db/models/manager.py", line 82, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/db/models/query.py", line 1125, in _insert
return query.get_compiler(using=using).execute_sql(return_id)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/db/models/sql/compiler.py", line 1283, in execute_sql
cursor.execute(sql, params)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/raven/contrib/django/client.py", line 127, in execute
return real_execute(self, sql, params)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/db/backends/utils.py", line 68, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/db/backends/utils.py", line 77, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/db/backends/utils.py", line 85, in _execute
return self.cursor.execute(sql, params)
File "/var/env/admin.studentlife.umn.edu/local/lib/python3.5/site-packages/django/db/backends/mysql/base.py", line 76, in execute
raise utils.IntegrityError(*tuple(e.args))
django.db.utils.IntegrityError: (1048, "Column 'width' cannot be null")