From 1371e64f17521d7ad6d4ca62ee38d2a2210337ab Mon Sep 17 00:00:00 2001 From: Pierrick Brun Date: Thu, 15 Jun 2023 14:10:31 +0200 Subject: [PATCH] [FIX] unlink bi_sql_view without cron --- bi_sql_editor/models/bi_sql_view.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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):