from django.db.models.signals import pre_save, post_save

@receiver(pre_save)
def pre_save_handler(sender, instance, *args, **kwargs):
    if case_error:
        pass
Cancel saving model when using pre_save in django