From f2ad63143a9cdcbbcaa08d69744d15f2b1d06c7a Mon Sep 17 00:00:00 2001 From: j Date: Fri, 4 Aug 2023 14:04:20 +0200 Subject: [PATCH] fix translation creation --- pandora/annotation/models.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora/annotation/models.py b/pandora/annotation/models.py index 8b83a3db1..9e31d1846 100644 --- a/pandora/annotation/models.py +++ b/pandora/annotation/models.py @@ -264,7 +264,10 @@ class Annotation(models.Model): from translation.models import Translation layer = self.get_layer() if layer.get('translate'): - Translation.objects.get_or_create(lang=lang, key=self.value, defaults={'type': Translation.CONTENT}) + for lang in settings.CONFIG['languages']: + if lang == settings.CONFIG['language']: + continue + Translation.objects.get_or_create(lang=lang, key=self.value, defaults={'type': Translation.CONTENT}) def delete(self, *args, **kwargs): with transaction.atomic():