From 513fd368ebe2ffc670fdbb1fe8521082632d4b9d Mon Sep 17 00:00:00 2001 From: insolor <2442833+insolor@users.noreply.github.com> Date: Tue, 7 May 2024 19:11:12 +0300 Subject: [PATCH] fix: check if the problem list is not empty before raising of ValidationException --- df_translation_toolkit/convert/objects_po_to_csv.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/df_translation_toolkit/convert/objects_po_to_csv.py b/df_translation_toolkit/convert/objects_po_to_csv.py index 25d3b4e..e15c2f2 100644 --- a/df_translation_toolkit/convert/objects_po_to_csv.py +++ b/df_translation_toolkit/convert/objects_po_to_csv.py @@ -46,7 +46,8 @@ def get_translations_from_tag(original_tag: str, translation_tag: str): translation_parts = translation_parts[1:] yield from get_translations_from_tag_parts(original_parts, translation_parts) - raise ValidationException(validation_problems) # pass warnings + if validation_problems: + raise ValidationException(validation_problems) # pass warnings def prepare_dictionary(dictionary: Iterable[tuple[str, str]], errors_file: TextIO) -> Iterable[tuple[str, str]]: