def save(self, *args, **kwargs): from weblate.accounts.tasks import notify_change if self.unit: self.translation = self.unit.translation if self.translation: self.component = self.translation.component if self.component: self.project = self.component.project if self.dictionary: self.project = self.dictionary.project super(Change, self).save(*args, **kwargs) notify_change.delay(self.pk)
def save(self, *args, **kwargs): from weblate.accounts.tasks import notify_change self.fixup_refereces() super().save(*args, **kwargs) transaction.on_commit(lambda: notify_change.delay(self.pk))
def save(self, *args, **kwargs): from weblate.accounts.tasks import notify_change if self.unit: self.translation = self.unit.translation if self.translation: self.component = self.translation.component self.language = self.translation.language if self.component: self.project = self.component.project super().save(*args, **kwargs) transaction.on_commit(lambda: notify_change.delay(self.pk))