1
0
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:
Jeremy Stretch
2018-08-07 09:12:05 -04:00
parent 1905516536
commit c7acddbc5c
3 changed files with 3 additions and 4 deletions

View File

@ -16,16 +16,14 @@ def is_report(obj):
"""
Returns True if the given object is a Report.
"""
if obj in Report.__subclasses__():
return True
return False
return obj in Report.__subclasses__()
def get_report(module_name, report_name):
"""
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)
if report is None:
return None