Update translated/fuzzy flags on save

This commit is contained in:
Michal Čihař 2012-02-28 14:35:31 +01:00
parent 14bf0fe4b0
commit db8f007e44

View File

@ -258,6 +258,8 @@ class Translation(models.Model):
store.save()
self.git_commit(author)
return need_save, pounit
class Unit(models.Model):
translation = models.ForeignKey(Translation)
checksum = models.CharField(max_length = 40, default = '', blank = True, db_index = True)
@ -311,7 +313,9 @@ class Unit(models.Model):
def save_backend(self, request, propagate = True):
# Store to backend
self.translation.update_unit(self, request)
(saved, pounit) = self.translation.update_unit(self, request)
self.translated = pounit.istranslated()
self.fuzzy = pounit.isfuzzy()
self.save(backend = True)
# Propagate to other projects
if propagate: