(*args, **kwargs)
| 20 | def has_context(func): |
| 21 | @functools.wraps(func) |
| 22 | def assert_context(*args, **kwargs): |
| 23 | if not context_value.get(): |
| 24 | raise exceptions.MissingCallbackContextException( |
| 25 | f"dash.callback_context.{getattr(func, '__name__')} is only available from a callback!" |
| 26 | ) |
| 27 | return func(*args, **kwargs) |
| 28 | |
| 29 | return assert_context |
| 30 |