Check Domains/Nameservers on Domain delete

This commit is contained in:
Sebastian Lohff 2017-03-29 12:26:37 +02:00
parent 80d4b1ad50
commit 1c95b05e8b
1 changed files with 4 additions and 1 deletions

View File

@ -97,7 +97,10 @@ class Maintainer(WhoisObject):
def getNoDeleteReasons(self):
reasons = []
mntables = [Contact, ASBlock, ASNumber, InetNum]
# FIXME: Tempfix for circular dependency problem
import domains.models
mntables = [Contact, ASBlock, ASNumber, InetNum, domains.models.Domain, domains.models.Nameserver]
for mntable in mntables:
candidates = mntable.objects.filter(mnt_by=self).annotate(mntCount=models.Count('mnt_by')).filter(mntCount__lte=1)
for candidate in candidates: