Ejemplo n.º 1
0
    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,
                })
Ejemplo n.º 2
0
    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,
                }))