fix translation creation

This commit is contained in:
j 2023-08-04 14:04:20 +02:00
parent 48aba7bde8
commit f2ad63143a

View file

@ -264,7 +264,10 @@ class Annotation(models.Model):
from translation.models import Translation from translation.models import Translation
layer = self.get_layer() layer = self.get_layer()
if layer.get('translate'): 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): def delete(self, *args, **kwargs):
with transaction.atomic(): with transaction.atomic():