mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #2312: Running a report yields a ValueError exception
This commit is contained in:
1
netbox/_reports
Submodule
1
netbox/_reports
Submodule
Submodule netbox/_reports added at b3a4494377
@ -16,16 +16,14 @@ def is_report(obj):
|
|||||||
"""
|
"""
|
||||||
Returns True if the given object is a Report.
|
Returns True if the given object is a Report.
|
||||||
"""
|
"""
|
||||||
if obj in Report.__subclasses__():
|
return obj in Report.__subclasses__()
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def get_report(module_name, report_name):
|
def get_report(module_name, report_name):
|
||||||
"""
|
"""
|
||||||
Return a specific report from within a module.
|
Return a specific report from within a module.
|
||||||
"""
|
"""
|
||||||
module = importlib.import_module('reports.{}'.format(module_name))
|
module = importlib.import_module(module_name)
|
||||||
report = getattr(module, report_name, None)
|
report = getattr(module, report_name, None)
|
||||||
if report is None:
|
if report is None:
|
||||||
return None
|
return None
|
||||||
|
Reference in New Issue
Block a user