fix deletion regex

This commit is contained in:
Matthew Spence 2025-02-07 10:45:21 -06:00
parent dea13ec27b
commit d4a5e3e400
No known key found for this signature in database

View file

@ -1040,7 +1040,7 @@ class Domain(TimeStampedModel, DomainHelper):
logger.info("Deleting subdomains for %s", self.name)
# check if any subdomains are in use by another domain
hosts = Host.objects.filter(name__regex=r".+{}".format(self.name))
hosts = Host.objects.filter(name__regex=r".+\.{}".format(self.name))
for host in hosts:
if host.domain != self:
logger.error("Unable to delete host: %s is in use by another domain: %s", host.name, host.domain)