[已解决]6.3.11最新版本无法批量导入用户


#1

错误及相关信息如下:

2019-01-25 23:15:53,514 [ERROR] seahub.views.sysadmin:1226 user_add ‘ascii’ codec can’t decode byte 0xe4 in position 0: ordinal not in range(128)
2019-01-25 23:58:50,919 [WARNING] seahub.utils.licenseparse:38 parse_license [Errno 2] No such file or directory: ‘/opt/seafile/seafile-pro-server-6.3.11/seahub/seahub/…/…/…/seafile-license.txt’
2019-01-25 23:58:51,344 [ERROR] django.request:135 handle_uncaught_exception Internal Server Error: /useradmin/batchadduser/
Traceback (most recent call last):
File “/opt/seafile/seafile-pro-server-6.3.11/seahub/thirdpart/django/core/handlers/exception.py”, line 41, in inner
response = get_response(request)
File “/opt/seafile/seafile-pro-server-6.3.11/seahub/thirdpart/django/core/handlers/base.py”, line 249, in _legacy_get_response
response = self._get_response(request)
File “/opt/seafile/seafile-pro-server-6.3.11/seahub/thirdpart/django/core/handlers/base.py”, line 187, in _get_response
response = self.process_exception_by_middleware(e, request)
File “/opt/seafile/seafile-pro-server-6.3.11/seahub/thirdpart/django/core/handlers/base.py”, line 185, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File “/opt/seafile/seafile-pro-server-6.3.11/seahub/seahub/auth/decorators.py”, line 27, in _wrapped_view
return view_func(request, *args, **kwargs)
File “/opt/seafile/seafile-pro-server-6.3.11/seahub/seahub/base/decorators.py”, line 26, in decorated
return func(request, *args, **kwargs)
File “/opt/seafile/seafile-pro-server-6.3.11/seahub/seahub/views/sysadmin.py”, line 2058, in batch_add_user
subject=
(u’You are invited to join %s’) % get_site_name(),
UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe4 in position 0: ordinal not in range(128)

没有配置邮箱,不知哪位碰到并解决过?

在seahub_settings.py中将SITE_NAME='XXX中文’注释掉即可;应该是SITE_NAME设置为中文后,python编码变换有问题;建议官方取消SITE_NAME在seahub_settings.py中的设置项,或者将SITE_NAME设置为支持中文字符的变量;此外,实测6.3.9也存在同样问题。