TypeError: 'NoneType' object is not iterable
__call__
def __call__(self, environ: dict, start_response: t.Callable) -> t.Any:
"""The WSGI server calls the Flask application object as the
WSGI application. This calls :meth:`wsgi_app`, which can be
wrapped to apply middleware.
"""
return self.wsgi_app(environ, start_response)
wsgi_app
try:
ctx.push()
response = self.full_dispatch_request()
except Exception as e:
error = e
response = self.handle_exception(e)
except: # noqa: B001
error = sys.exc_info()[1]
raise
return response(environ, start_response)
finally:
wsgi_app
ctx = self.request_context(environ)
error: t.Optional[BaseException] = None
try:
try:
ctx.push()
response = self.full_dispatch_request()
except Exception as e:
error = e
response = self.handle_exception(e)
except: # noqa: B001
error = sys.exc_info()[1]
full_dispatch_request
request_started.send(self)
rv = self.preprocess_request()
if rv is None:
rv = self.dispatch_request()
except Exception as e:
rv = self.handle_user_exception(e)
return self.finalize_request(rv)
def finalize_request(
self,
rv: t.Union[ResponseReturnValue, HTTPException],
full_dispatch_request
self.try_trigger_before_first_request_functions()
try:
request_started.send(self)
rv = self.preprocess_request()
if rv is None:
rv = self.dispatch_request()
except Exception as e:
rv = self.handle_user_exception(e)
return self.finalize_request(rv)
def finalize_request(
dispatch_request
getattr(rule, "provide_automatic_options", False)
and req.method == "OPTIONS"
):
return self.make_default_options_response()
# otherwise dispatch to the handler for that endpoint
return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
def full_dispatch_request(self) -> Response:
"""Dispatches the request and on top of that performs request
pre and postprocessing as well as HTTP exception catching and
error handling.
wrapper
return val
else:
@wraps(wrapped=func)
def wrapper(*args, **kwargs):
prof = get_prof()
val = prof(func)(*args, **kwargs)
show_results_bound(prof)
return val
return wrapper
else:
f
res = yield from func(*args, **kwargs)
return res
else:
def f(*args, **kwds):
with self._count_ctxmgr():
return func(*args, **kwds)
return f
def runctx(self, cmd, globals, locals):
""" Profile a single executable statement in the given namespaces.
table_info
@mp.profile
def table_info(dbname, slug):
logging.info('Table info %s %s' % (dbname, slug))
object = _get_table(dbname, slug)
package = _get_package_by_id(object['package'])
if 'eve' in object.keys() and object['eve']['schema']:
object['human_schema'] = json2html.convert(object['eve']['schema'], table_attributes='class="class="table table-condensed table-striped""')
object['api_url'] = settings.API_PREFIX + object['dbname'] + '/' + object['slug']
object['publicapi_url'] = settings.PUBLICAPI_PREFIX + object['dbname'] + '/' + object['slug']
wrapper
return val
else:
@wraps(wrapped=func)
def wrapper(*args, **kwargs):
prof = get_prof()
val = prof(func)(*args, **kwargs)
show_results_bound(prof)
return val
return wrapper
else:
f
res = yield from func(*args, **kwargs)
return res
else:
def f(*args, **kwds):
with self._count_ctxmgr():
return func(*args, **kwds)
return f
def runctx(self, cmd, globals, locals):
""" Profile a single executable statement in the given namespaces.
_get_table
return list(objects)
@mp.profile
def _get_table(dbname, slug):
tabcoll = _get_collection(client=None, dbname=settings.MANAGEAPI_DB, collname=settings.MANAGEAPI_TABLE)
object = dict(tabcoll.find_one({'dbname' : dbname, 'slug' : slug}))
fields = _get_collection(client=None, dbname=settings.MANAGEAPI_DB, collname=settings.MANAGEAPI_FIELDS)
# object['fieldsmeta'] = list(fields.find({'table' : object['_id']}))
object['fieldsmeta'] = []
for o in list(fields.find({'table' : object['_id']})):
if 'indexes' in object.keys():
TypeError: 'NoneType' object is not iterable
This is the Copy/Paste friendly version of the traceback.
The console is locked and needs to be unlocked by entering the PIN. You can find the PIN printed out on the standard output of your shell that runs the server.