Commit 94f2682b authored by Michal Čihař's avatar Michal Čihař

Trigger fulltext index update on source string change

Issue #405
Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent ee1a1acf
......@@ -602,16 +602,19 @@ class Unit(models.Model):
This is needed when editing template translation for monolingual
formats.
"""
# Find relevant units
same_source = Unit.objects.filter(
translation__subproject=self.translation.subproject,
context=self.context,
)
# Update source and contentsum
same_source.update(
source=self.target,
contentsum = calculate_checksum(self.source, self.context),
)
# TODO:
# - update fulltext index
# Update source index, it's enough to do it for one as we index by
# checksum which is same for all
update_index_unit(self, True)
def generate_change(self, request, author, oldunit, change_action):
"""
......
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