Update translated/fuzzy flags on save
This commit is contained in:
parent
14bf0fe4b0
commit
db8f007e44
|
@ -258,6 +258,8 @@ class Translation(models.Model):
|
||||||
store.save()
|
store.save()
|
||||||
self.git_commit(author)
|
self.git_commit(author)
|
||||||
|
|
||||||
|
return need_save, pounit
|
||||||
|
|
||||||
class Unit(models.Model):
|
class Unit(models.Model):
|
||||||
translation = models.ForeignKey(Translation)
|
translation = models.ForeignKey(Translation)
|
||||||
checksum = models.CharField(max_length = 40, default = '', blank = True, db_index = True)
|
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):
|
def save_backend(self, request, propagate = True):
|
||||||
# Store to backend
|
# 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)
|
self.save(backend = True)
|
||||||
# Propagate to other projects
|
# Propagate to other projects
|
||||||
if propagate:
|
if propagate:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user