From fd05ec40262497ca30603b81c535ee8b063b948c Mon Sep 17 00:00:00 2001 From: usmannasir Date: Wed, 23 Oct 2024 11:25:29 +0400 Subject: [PATCH] bug fix: soa parsing ref https://github.com/usmannasir/cyberpanel/issues/1341 --- plogical/dnsUtilities.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/plogical/dnsUtilities.py b/plogical/dnsUtilities.py index 077fbdfdd..a7924982a 100755 --- a/plogical/dnsUtilities.py +++ b/plogical/dnsUtilities.py @@ -680,11 +680,16 @@ class DNS: return if zone.type == 'MASTER': - getSOA = Records.objects.get(domainOwner=zone, type='SOA') - soaContent = getSOA.content.split(' ') - soaContent[2] = str(int(soaContent[2]) + 1) - getSOA.content = " ".join(soaContent) - getSOA.save() + try: + for getSOA in Records.objects.filter(domainOwner=zone, type='SOA'): + #getSOA = Records.objects.get(domainOwner=zone, type='SOA') + soaContent = getSOA.content.split(' ') + soaContent[2] = str(int(soaContent[2]) + 1) + getSOA.content = " ".join(soaContent) + getSOA.save() + except: + pass + if type == 'NS': if Records.objects.filter(name=name, type=type, content=value).count() == 0: