diff options
| author | Aymeric Augustin | 2013-10-21 15:51:13 +0200 |
|---|---|---|
| committer | Aymeric Augustin | 2013-10-21 15:51:13 +0200 |
| commit | 6768be17c4a9bd151fa90363c559bd15aeb395e7 (patch) | |
| tree | 9afabcdace9d0ebf70de4bda33b632ae384507e7 /debug_toolbar/utils | |
| parent | 5b1fd5a96eca2522b173ea6266ecef026fab78c6 (diff) | |
| download | django-debug-toolbar-6768be17c4a9bd151fa90363c559bd15aeb395e7.tar.bz2 | |
Minor cleanup.
Diffstat (limited to 'debug_toolbar/utils')
| -rw-r--r-- | debug_toolbar/utils/__init__.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/debug_toolbar/utils/__init__.py b/debug_toolbar/utils/__init__.py index 31641e6..da2e3c3 100644 --- a/debug_toolbar/utils/__init__.py +++ b/debug_toolbar/utils/__init__.py @@ -22,9 +22,9 @@ config = getattr(settings, 'DEBUG_TOOLBAR_CONFIG', {}) hide_django_sql = config.get('HIDE_DJANGO_SQL', True) -def get_module_path(module_string): +def get_module_path(module_name): try: - module = import_module(module_string) + module = import_module(module_name) except ImportError as e: raise ImproperlyConfigured( 'Error importing HIDDEN_STACKTRACE_MODULES: %s' % (e,)) @@ -49,10 +49,7 @@ hidden_paths = [ def omit_path(path): - for hidden_path in hidden_paths: - if hidden_path in path: - return True - return False + return any(path.startswith(hidden_path) for hidden_path in hidden_paths) def tidy_stacktrace(stack): |
