...
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user