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

Automatically set translation/subproject for created change entries

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent b018bce3
......@@ -292,3 +292,10 @@ class Change(models.Model):
self.target and
self.action in self.ACTIONS_REVERTABLE
)
def save(self, *args, **kwargs):
if self.unit:
self.translation = self.unit.translation
if self.translation:
self.subproject = self.translation.subproject
super(Change, self).save(*args, **kwargs)
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