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

Add method for accepting suggestion

parent d22378b0
......@@ -427,3 +427,14 @@ class Suggestion(models.Model):
user = models.ForeignKey(User, null = True, blank = True)
project = models.ForeignKey(Project)
language = models.ForeignKey(Language)
def accept(self, request):
allunits = Unit.objects.filter(
checksum = self.checksum,
translation__subproject__project = self.project,
translation__language = self.language
)
for unit in allunits:
unit.target = self.target
unit.fuzzy = False
unit.save_backend(request, False)
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