This commit is contained in:
Holger Sielaff
2025-08-05 14:44:54 +02:00
parent bc4463b68e
commit 6947b70764
3 changed files with 22 additions and 3 deletions

View File

@@ -162,8 +162,10 @@ class TranslatableMixin:
return json.dumps({current_lang: str(value)})
def validate(self, value, model_instance):
if not self.translatable or not value or not isinstance(value, (str, dict)):
super().validate(value, model_instance)
if not self.translatable or not value:
return super().validate(value, model_instance)
if not isinstance(value, dict):
return super().validate(value, model_instance)
# Validate each translation individually
for lang_code, translation in value.items():