forked from s_ranjbar/city_retrofit
correct bug
This commit is contained in:
parent
6809a4fca3
commit
11ba482e73
|
@ -15,10 +15,8 @@ def validate_import_export_type(cls_name: type, handler: str):
|
||||||
:param handler: import export handler
|
:param handler: import export handler
|
||||||
:return: None
|
:return: None
|
||||||
"""
|
"""
|
||||||
functions = [
|
functions = [function[1:] for function in dir(cls_name) if (type(getattr(cls_name, function)) is property or callable(getattr(cls_name, function))) and function in cls_name.__dict__ and function[0] == '_' and function != '__init__']
|
||||||
function[1:] for function in dir(cls_name)
|
|
||||||
if type(getattr(cls_name, function)) in (property, callable(getattr(cls_name, function))) and function in cls_name.__dict__ and function[0] == '_' and function != '__init__'
|
|
||||||
]
|
|
||||||
if handler.lower() not in functions:
|
if handler.lower() not in functions:
|
||||||
error_message = f'Wrong import type [{handler}]. Valid functions include {functions}'
|
error_message = f'Wrong import type [{handler}]. Valid functions include {functions}'
|
||||||
logging.error(error_message)
|
logging.error(error_message)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user