Просмотр исходного кода

Fixes #2312: Running a report yields a ValueError exception

Jeremy Stretch 7 лет назад
Родитель
Сommit
c7acddbc5c
3 измененных файлов с 3 добавлено и 4 удалено
  1. 1 0
      netbox/_reports
  2. 2 4
      netbox/extras/reports.py
  3. 0 0
      netbox/reports/__init__.py

+ 1 - 0
netbox/_reports

@@ -0,0 +1 @@
+Subproject commit b3a449437792668041d5cfb9cd6d025e1a5b3470

+ 2 - 4
netbox/extras/reports.py

@@ -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 True
-    return False
+    return obj in Report.__subclasses__()
 
 
 
 
 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

+ 0 - 0
netbox/reports/__init__.py