在更新微信群组是报错:
[2017-08-29 16:23:27,812: INFO/ForkPoolWorker-2] <Bot: 布道>: updating groups
[2017-08-29 16:23:32,250: ERROR/ForkPoolWorker-2] Task wechat.tasks.update_group[7b964b48-9ee4-4757-aac1-4c309db96921] raised unexpected: TypeError("object of type 'NoneType' has no len()",)
Traceback (most recent call last):
File "/usr/local/python35/lib/python3.5/site-packages/celery/app/trace.py", line 367, in trace_task
R = retval = fun(*args, *kwargs)
File "/usr/local/python35/lib/python3.5/site-packages/celery/app/trace.py", line 622, in __protected_call__
return self.run(args, **kwargs)
File "/root/wechat-admin/wechat/tasks.py", line 169, in update_group
_update_group(bot, update=update)
File "/root/wechat-admin/wechat/tasks.py", line 75, in _update_group
for field in USER_FIELD})
File "/root/wechat-admin/models/mixin.py", line 9, in create
obj = session.query(cls).get(kw['id'])
File "/usr/local/python35/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 864, in get
return self._get_impl(ident, loading.load_on_ident)
File "/usr/local/python35/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 875, in _get_impl
if len(ident) != len(mapper.primary_key):
TypeError: object of type 'NoneType' has no len()
在更新微信群组是报错: [2017-08-29 16:23:27,812: INFO/ForkPoolWorker-2] <Bot: 布道>: updating groups [2017-08-29 16:23:32,250: ERROR/ForkPoolWorker-2] Task wechat.tasks.update_group[7b964b48-9ee4-4757-aac1-4c309db96921] raised unexpected: TypeError("object of type 'NoneType' has no len()",) Traceback (most recent call last): File "/usr/local/python35/lib/python3.5/site-packages/celery/app/trace.py", line 367, in trace_task R = retval = fun(*args, *kwargs) File "/usr/local/python35/lib/python3.5/site-packages/celery/app/trace.py", line 622, in __protected_call__ return self.run(args, **kwargs) File "/root/wechat-admin/wechat/tasks.py", line 169, in update_group _update_group(bot, update=update) File "/root/wechat-admin/wechat/tasks.py", line 75, in _update_group for field in USER_FIELD}) File "/root/wechat-admin/models/mixin.py", line 9, in create obj = session.query(cls).get(kw['id']) File "/usr/local/python35/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 864, in get return self._get_impl(ident, loading.load_on_ident) File "/usr/local/python35/lib/python3.5/site-packages/sqlalchemy/orm/query.py", line 875, in _get_impl if len(ident) != len(mapper.primary_key): TypeError: object of type 'NoneType' has no len()