From 44fe17754ae467d253732fac8cd1cc4c134256e3 Mon Sep 17 00:00:00 2001 From: yackob03 Date: Wed, 5 Feb 2014 20:00:18 -0500 Subject: [PATCH] Fix the API discovery method to not rely on globals(). --- endpoints/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/endpoints/api.py b/endpoints/api.py index 027503f45..a6a69f433 100644 --- a/endpoints/api.py +++ b/endpoints/api.py @@ -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']))