From d271c44adf45d71454dd542fd385b682cc6618e7 Mon Sep 17 00:00:00 2001 From: rune Date: Tue, 28 Mar 2023 11:41:06 +0200 Subject: [PATCH] Fixed bug in SQL for adding new subdomain --- ddns.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ddns.py b/ddns.py index f116815..7769440 100755 --- a/ddns.py +++ b/ddns.py @@ -124,6 +124,7 @@ def add_domian(domain): def add_subdomain(domain): + now = datetime.now().strftime("%Y-%m-%d %H:%M") if set(domain).difference(ascii_letters + '.' + digits): print('[red]Error:[/red] Give the domain name in simple form e.g. [b]test.domain.com[/b]') else: @@ -160,7 +161,7 @@ def add_subdomain(domain): if response != 'Fail': response_data = response.json() domainid = str(response_data['domain_record']['id']) - cursor.execute('INSERT INTO subdomains values(?,?,?,?,?)',(domainid,topdomain_id,sub,ip,None,)) + cursor.execute('INSERT INTO subdomains values(?,?,?,?,?,?,?)',(domainid,topdomain_id,sub,ip,None,now,now,)) conn.commit() print('The domain %s has been added.' % (domain)) logging.info(time.strftime("%Y-%m-%d %H:%M") + ' - Info : subdomain %s added'%(domain))