示例#1
0
 def post_save(self, series, created=False):
     if self._old_reviewer != series.reviewer:
         old = self._old_reviewer.pk if self._old_reviewer else None
         new = series.reviewer.pk if series.reviewer else None
         url = self.request.build_absolute_uri(series.get_absolute_url())
         send_reviewer_notification.delay(series.pk, url,
                                          self.request.user.pk, old, new)
示例#2
0
 def post_save(self, series, created=False):
     if self._old_reviewer != series.reviewer:
         old = self._old_reviewer.pk if self._old_reviewer else None
         new = series.reviewer.pk if series.reviewer else None
         url = self.request.build_absolute_uri(series.get_absolute_url())
         send_reviewer_notification.delay(series.pk, url,
                                          self.request.user.pk,
                                          old, new)
示例#3
0
文件: api.py 项目: dlespiau/patchwork
    def perform_update(self, serializer):
        series = self.get_object()
        self._old_reviewer = series.reviewer

        series = serializer.save()

        if self._old_reviewer != series.reviewer:
            old = self._old_reviewer.pk if self._old_reviewer else None
            new = series.reviewer.pk if series.reviewer else None
            url = self.request.build_absolute_uri(series.get_absolute_url())
            send_reviewer_notification.delay(series.pk, url,
                                             self.request.user.pk, old, new)