diff --git a/bi_sql_editor/models/bi_sql_view.py b/bi_sql_editor/models/bi_sql_view.py index 42439bf68..4fed3c65c 100644 --- a/bi_sql_editor/models/bi_sql_view.py +++ b/bi_sql_editor/models/bi_sql_view.py @@ -263,7 +263,8 @@ class BiSQLView(models.Model): "If you want to delete them, first set them to draft." ) ) - self.cron_id.unlink() + if self.cron_id: + self.cron_id.unlink() return super().unlink() def copy(self, default=None):