Commit 56331804 authored by Michal Čihař's avatar Michal Čihař

Generate missing objects on fly

parent 0cfaf48e
......@@ -75,13 +75,13 @@ class TranslationManager(models.Manager):
'''
try:
lang = Language.objects.get(code = code)
translation, created = self.get_or_create(
language = lang,
subproject = subproject,
filename = path)
translation.update_from_blob(blob_hash, force)
except Language.DoesNotExist:
pass
lang = Language.objects.create(code = code, name = '%s (generated)' % code)
translation, created = self.get_or_create(
language = lang,
subproject = subproject,
filename = path)
translation.update_from_blob(blob_hash, force)
class UnitManager(models.Manager):
def update_from_unit(self, translation, unit, pos):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment