-
Notifications
You must be signed in to change notification settings - Fork 133
Open
Description
If the user has provided a view_decorator, and this decorator fails to be imported, django-plotly-dash will default to no decoration as it swallows all exceptions.
django-plotly-dash/django_plotly_dash/access.py
Lines 36 to 48 in 4edb730
try: | |
dash_view_decorator_name = settings.PLOTLY_DASH['view_decorator'] | |
try: | |
dash_view_decorator = locals()[dash_view_decorator_name] | |
except: | |
mod_name, func_name = dash_view_decorator_name.rsplit('.', 1) | |
if mod_name: | |
mod = importlib.import_module(mod_name) | |
dash_view_decorator = getattr(mod, func_name) | |
else: | |
dash_view_decorator = locals()[func_name] | |
except: | |
dash_view_decorator = None |
It'd be more sensible to raise an exception in such cases (maybe ImproperlyConfigured?), so the user is immediately notified of their error and can fix it. Technically a breaking change but hopefully one for the better.
Metadata
Metadata
Assignees
Labels
No labels