示例#1
0
 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)
示例#2
0
文件: change.py 项目: nijel/weblate
 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)
示例#3
0
    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))
示例#4
0
    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))