Skip to content

Commit

Permalink
Merge pull request #4384 from open-formulieren/issue/4362-remove-defa…
Browse files Browse the repository at this point in the history
…ult-value-translation-support

Add detection for defaultValue translations
  • Loading branch information
sergei-maertens authored Jun 13, 2024
2 parents e9012b2 + 7313810 commit 54cb59e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bin/report_component_problems.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ def check_component(component: Component) -> str | None:
if default_value not in expected_values:
return f"Default value '{default_value}' is not valid."

case {
"type": "textfield" | "textarea",
"openForms": {"translations": dict() as translations},
}:
for translation_dict in translations.values():
if not isinstance(translation_dict, dict):
return "invalid translations structure"
if bool(translation_dict.get("defaultValue")):
return "defaultValue has a translation"


def report_problems(component_types: Sequence[str]) -> bool:
from openforms.forms.models import FormDefinition
Expand Down

0 comments on commit 54cb59e

Please sign in to comment.