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)
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)