Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

App should raise an Exception on misconfigured view_decorator #522

Open
@spiqueras

Description

@spiqueras

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.

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)
ifmod_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 (maybeImproperlyConfigured?), 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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp