Skip to content
Snippets Groups Projects
Verified Commit c64812c0 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

BUG: fix table export find_func

parent c8c555b2
Branches
Tags
1 merge request!89ENH: JsonSchemaExporter accepts do_not_create parameter.
...@@ -207,18 +207,16 @@ class BaseTableExporter(object): ...@@ -207,18 +207,16 @@ class BaseTableExporter(object):
logger.error(errmssg) logger.error(errmssg)
def _call_find_function(self, find_function, e): def _call_find_function(self, find_function, e):
account_for_self = 0
if callable(find_function): if callable(find_function):
find_fun = find_function find_fun = find_function
else: else:
find_fun = getattr(self, find_function) find_fun = getattr(self, find_function)
account_for_self = 1
sig = signature(find_fun) sig = signature(find_fun)
params = sig.parameters params = sig.parameters
if len(params) > (account_for_self + 1): if len(params) > 1:
return find_fun(self.record, e) return find_fun(self.record, e)
elif len(params) > account_for_self: elif len(params) > 0:
return find_fun(self.record) return find_fun(self.record)
return find_fun() return find_fun()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment