def save(self, *args, **kwargs): adding = self._state.adding super().save(*args, **kwargs) if adding: validate_docker_image.apply_async( kwargs={ "app_label": self._meta.app_label, "model_name": self._meta.model_name, "pk": self.pk, })
def save(self, *args, **kwargs): if self.image != self._image_orig: self.ready = False super().save(*args, **kwargs) if not self.ready: on_commit(lambda: validate_docker_image.apply_async( kwargs={ "app_label": self._meta.app_label, "model_name": self._meta.model_name, "pk": self.pk, }))