Skip to content

Commit

Permalink
Unit: Fix state calculation with intermediate language
Browse files Browse the repository at this point in the history
Issue #3270
  • Loading branch information
nijel committed Apr 7, 2020
1 parent da5b1bd commit 662905a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions weblate/trans/models/unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,14 @@ def get_absolute_url(self):

def get_unit_state(self, unit, flags):
"""Calculate translated and fuzzy status."""
if unit.is_readonly() or (
flags is not None and "read-only" in self.get_all_flags(flags)
if (
unit.is_readonly()
or (flags is not None and "read-only" in self.get_all_flags(flags))
or (
flags is not None
and self.source_info != self
and self.source_info.state < STATE_TRANSLATED
)
):
return STATE_READONLY

Expand Down Expand Up @@ -506,7 +512,7 @@ def save_backend(self, user, propagate=True, change_action=None, author=None):
if self.old_unit.state == self.state and self.old_unit.target == self.target:
return False

if self.translation.is_source:
if self.translation.is_source and not self.translation.component.intermediate:
self.source = self.target
self.content_hash = calculate_hash(self.source, self.context)

Expand Down

0 comments on commit 662905a

Please sign in to comment.