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.
This commit is contained in:
SIPOS, Peter 2016-11-21 13:30:16 +01:00
parent c81deb0044
commit 94b0d26142

View File

@ -507,6 +507,10 @@ class Domain(db.Model):
if domain_user: if domain_user:
domain_user.delete() domain_user.delete()
db.session.commit() 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 # then remove domain
Domain.query.filter(Domain.name == d).delete() Domain.query.filter(Domain.name == d).delete()