David Jean Louis avatar David Jean Louis committed d0a49dc

Removed try/except blocks in functions that retrieve custom dashboards and menus, they just make debug painful.

Comments (0)

Files changed (2)

admin_tools/dashboard/utils.py

         return get_app_index_dashboard(context)
     raise ValueError('Invalid dashboard location: "%s"' % location)
 
+
 def get_index_dashboard(context):
     """
     Returns the admin dashboard defined by the user or the default one.
         'ADMIN_TOOLS_INDEX_DASHBOARD',
         'admin_tools.dashboard.DefaultIndexDashboard'
     )
-    try:
-        mod, inst = dashboard_cls.rsplit('.', 1)
-        mod = import_module(mod)
-    except:
-        raise ImproperlyConfigured((
-            'The class pointed by your ADMIN_TOOLS_INDEX_DASHBOARD '
-            'setting variable cannot be imported'
-        ))
+    mod, inst = dashboard_cls.rsplit('.', 1)
+    mod = import_module(mod)
     return getattr(mod, inst)()
 
 
         'ADMIN_TOOLS_APP_INDEX_DASHBOARD',
         'admin_tools.dashboard.DefaultAppIndexDashboard'
     )
-    try:
-        mod, inst = dashboard_cls.rsplit('.', 1)
-        mod = import_module(mod)
-    except:
-        raise ImproperlyConfigured((
-            'The class pointed by your ADMIN_TOOLS_APP_INDEX_DASHBOARD '
-            'setting variable cannot be imported'
-        ))
+    mod, inst = dashboard_cls.rsplit('.', 1)
+    mod = import_module(mod)
     return getattr(mod, inst)(app_title, model_list)

admin_tools/menu/utils.py

         'ADMIN_TOOLS_MENU',
         'admin_tools.menu.DefaultMenu'
     )
-    try:
-        mod, inst = menu_cls.rsplit('.', 1)
-        mod = import_module(mod)
-    except Exception, exc:
-        raise ImproperlyConfigured((
-            'The class pointed by your ADMIN_TOOLS_MENU setting variable '
-            'cannot be imported: %s' % exc.message
-        ))
+    mod, inst = menu_cls.rsplit('.', 1)
+    mod = import_module(mod)
     return getattr(mod, inst)()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.