diff --git a/src/openforms/config/data.py b/src/openforms/config/data.py index c377a14b53..70a7fc0c68 100644 --- a/src/openforms/config/data.py +++ b/src/openforms/config/data.py @@ -3,7 +3,9 @@ from django.contrib.admin.templatetags.admin_list import _boolean_icon -Action: TypeAlias = tuple[str, str] +from openforms.typing import _StrOrPromise + +Action: TypeAlias = tuple[_StrOrPromise, str] # (label, reversed URL path) @dataclass diff --git a/src/openforms/plugins/plugin.py b/src/openforms/plugins/plugin.py index afa63360b7..ed772770d3 100644 --- a/src/openforms/plugins/plugin.py +++ b/src/openforms/plugins/plugin.py @@ -1,5 +1,8 @@ +from collections.abc import Sequence + from django.utils.translation import gettext_lazy as _ +from openforms.config.data import Action from openforms.config.models import GlobalConfiguration from .registry import BaseRegistry @@ -43,7 +46,7 @@ def check_config(self): """ raise NotImplementedError() - def get_config_actions(self) -> list[tuple[str, str]]: + def get_config_actions(self) -> Sequence[Action]: """ Returns a list of tuples containing the label and URL of each action that is related to the configuration of this plugin. This can be to diff --git a/src/openforms/prefill/contrib/demo/plugin.py b/src/openforms/prefill/contrib/demo/plugin.py index 31d2d9aa79..0887574bb4 100644 --- a/src/openforms/prefill/contrib/demo/plugin.py +++ b/src/openforms/prefill/contrib/demo/plugin.py @@ -5,6 +5,7 @@ from django.utils.crypto import get_random_string from django.utils.translation import gettext_lazy as _ +from openforms.config.data import Action from openforms.submissions.models import Submission from ...base import BasePlugin @@ -44,8 +45,8 @@ def get_prefill_values( """ return {attr: CALLBACKS[attr]() for attr in attributes} - def check_config(self): + def check_config(self) -> list[Action]: """ Demo config is always valid. """ - pass + return []