From 94b0d261425673a5738b6565952a555916a51f42 Mon Sep 17 00:00:00 2001 From: "SIPOS, Peter" Date: Mon, 21 Nov 2016 13:30:16 +0100 Subject: [PATCH] Delete settings related to domain on domain deleting Because this bug domain deleting isn't possible when a domain specific attribute is set (eg. dyndns). This modification delete domain settings before domain deleting. --- app/models.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/models.py b/app/models.py index 533e701..bfa57c4 100644 --- a/app/models.py +++ b/app/models.py @@ -507,6 +507,10 @@ class Domain(db.Model): if domain_user: domain_user.delete() db.session.commit() + domain_setting = DomainSetting.query.filter(DomainSetting.domain_id==domain.id) + if domain_setting: + domain_setting.delete() + db.session.commit() # then remove domain Domain.query.filter(Domain.name == d).delete()