Return Storage as json causes 'NoneType' object is not callable

23 views
Skip to first unread message

Val K

unread,
May 21, 2019, 7:53:11 PM5/21/19
to web2py-users
Hello!
I use windows binaries (2.18.5-stable+timestamp.2019.04.08.04.22.03)
 and get  'NoneType' object is not callable when call this simple function:

from gluon.tools import Storage

@service.json
def echo():
   
return Storage(a=1)  # return dict(a=1) - works fine

5048.
5049.
5050.
5051.
5052.
5053.
5054.
5055.
5056.
5057.
            args = request.args
d = dict(request.vars)
if args and args[0] in self.json_procedures:
s = self.call_service_function(self.json_procedures[args[0]], *args[1:], **d)
if hasattr(s, 'as_list'):
s = s.as_list() # - the problem is here
return response.json(s)
self.error()

class JsonRpcException(Exception):

Is that the windows-bin only issue?


Val K

unread,
May 22, 2019, 2:04:14 AM5/22/19
to web2py-users
Solved, it is a gluon bug, should be:
if hasattr(s, 'as_list') and s.as_list:

Reply all
Reply to author
Forward
0 new messages