parent
713c669e28
commit
23ebe2ff3e
|
|
@ -3,6 +3,15 @@ Changelog
|
||||||
#########
|
#########
|
||||||
|
|
||||||
|
|
||||||
|
*********
|
||||||
|
**1.7.3**
|
||||||
|
*********
|
||||||
|
|
||||||
|
*Release date: May 12, 2018*
|
||||||
|
|
||||||
|
- **FIXED:** views whose ``__init__`` methods throw exceptions will now be ignored during endpoint enumeration
|
||||||
|
|
||||||
|
|
||||||
*********
|
*********
|
||||||
**1.7.2**
|
**1.7.2**
|
||||||
*********
|
*********
|
||||||
|
|
|
||||||
|
|
@ -86,14 +86,17 @@ class EndpointEnumerator(_EndpointEnumerator):
|
||||||
for pattern in patterns:
|
for pattern in patterns:
|
||||||
path_regex = prefix + get_original_route(pattern)
|
path_regex = prefix + get_original_route(pattern)
|
||||||
if isinstance(pattern, URLPattern):
|
if isinstance(pattern, URLPattern):
|
||||||
path = self.get_path_from_regex(path_regex)
|
try:
|
||||||
callback = pattern.callback
|
path = self.get_path_from_regex(path_regex)
|
||||||
url_name = pattern.name
|
callback = pattern.callback
|
||||||
if self.should_include_endpoint(path, callback, app_name or '', namespace or '', url_name):
|
url_name = pattern.name
|
||||||
path = self.replace_version(path, callback)
|
if self.should_include_endpoint(path, callback, app_name or '', namespace or '', url_name):
|
||||||
for method in self.get_allowed_methods(callback):
|
path = self.replace_version(path, callback)
|
||||||
endpoint = (path, method, callback)
|
for method in self.get_allowed_methods(callback):
|
||||||
api_endpoints.append(endpoint)
|
endpoint = (path, method, callback)
|
||||||
|
api_endpoints.append(endpoint)
|
||||||
|
except Exception:
|
||||||
|
logger.warning('failed to enumerate view', exc_info=True)
|
||||||
|
|
||||||
elif isinstance(pattern, URLResolver):
|
elif isinstance(pattern, URLResolver):
|
||||||
nested_endpoints = self.get_api_endpoints(
|
nested_endpoints = self.get_api_endpoints(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue