Fix the API discovery method to not rely on globals().

This commit is contained in:
yackob03 2014-02-05 20:00:18 -05:00
parent c919b9321b
commit 44fe17754a

View file

@ -70,7 +70,7 @@ def get_route_data():
routes = []
for rule in app.url_map.iter_rules():
if rule.endpoint.startswith('api.'):
endpoint_method = globals()[rule.endpoint[4:]] # Remove api.
endpoint_method = app.view_functions[rule.endpoint]
is_internal = '__internal_call' in dir(endpoint_method)
is_org_api = '__user_call' in dir(endpoint_method)
methods = list(rule.methods.difference(['HEAD', 'OPTIONS']))