Fix error when no email can be found

pull/1/head
Mark Veidemanis 2 years ago
parent d7adffb47f
commit 2c3d83fe9a
Signed by: m
GPG Key ID: 5ACFCEED46C0904F

@ -1,7 +1,8 @@
from json import dumps
import main
from modules import chankeep
from modules import helpers
from json import dumps
class DedupCommand:
def __init__(self, *args):

@ -1,6 +1,5 @@
import main
from modules import chankeep
from utils.logging.debug import debug

@ -55,8 +55,7 @@ def substitute(net, num, token=None):
email = f"{alias['nickname']}@{domain}"
gotemail = True
if not gotemail:
error(f"Could not get email for {net} - {num}")
return False
inst["email"] = False
nickname = alias["nick"]
# username = nickname + "/" + net
password = main.network[net].aliases[num]["password"]
@ -73,7 +72,8 @@ def substitute(net, num, token=None):
inst[i] = inst[i].replace("{nickname}", nickname)
inst[i] = inst[i].replace("{curnick}", curnick)
inst[i] = inst[i].replace("{password}", password)
inst[i] = inst[i].replace("{email}", email)
if gotemail:
inst[i] = inst[i].replace("{email}", email)
if token:
inst[i] = inst[i].replace("{token}", token)
return inst
@ -85,6 +85,9 @@ def registerAccount(net, num):
if not sinst:
error(f"Register account failed for {net} - {num}")
return
if not sinst["email"]:
error(f"Could not get email for {net} - {num}")
return
if not sinst["register"]:
error("Cannot register for %s: function disabled" % (net))
return False

Loading…
Cancel
Save