From a67034de27a89bfcac6dc1c13349f890f519e155 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 21 May 2025 11:56:23 +1000 Subject: [PATCH] fix: DNS save to have work correctly --- account.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/account.py b/account.py index c481add..d92d15d 100644 --- a/account.py +++ b/account.py @@ -529,10 +529,24 @@ def setDNS(account, domain, records): for txt in record['txt']: TXTRecords.append(txt) elif record['type'] == 'NS': - newRecords.append({ - 'type': 'NS', - 'ns': record['value'] - }) + if 'value' in record: + newRecords.append({ + 'type': 'NS', + 'ns': record['value'] + }) + elif 'ns' in record: + newRecords.append({ + 'type': 'NS', + 'ns': record['ns'] + }) + else: + return { + 'error': { + 'message': 'Invalid NS record' + } + } + + elif record['type'] in ['GLUE4', 'GLUE6', "SYNTH4", "SYNTH6"]: newRecords.append({ 'type': record['type'],