misc: search endpoints on model not on the instance (#60836)
Instance have property descriptors which can fail on a getattr(), raising errors during getmembers(), by iterating on the class we work around that.
This commit is contained in:
parent
1c5c7e5454
commit
498813542f
|
@ -279,7 +279,7 @@ class BaseResource(models.Model):
|
|||
|
||||
def get_endpoints_infos(self):
|
||||
endpoints = []
|
||||
for dummy, method in inspect.getmembers(self, predicate=inspect.ismethod):
|
||||
for dummy, method in inspect.getmembers(type(self), predicate=inspect.isfunction):
|
||||
if hasattr(method, 'endpoint_info'):
|
||||
method.endpoint_info.object = self
|
||||
endpoint_name = method.endpoint_info.name
|
||||
|
|
Loading…
Reference in New Issue