Reformatted code base using black.

This commit is contained in:
Goffi 2024-06-19 18:44:57 +02:00
commit 53fdaa9d09

View file

@ -314,7 +314,8 @@ class MiscAccount(object):
# there is no email when an existing XMPP account is used
body = f"New account created on {domain}: {profile} [{email or '<no email>'}]"
d_admin = sat_email.send_email(
self.host.memory.config, admins_emails, subject, body)
self.host.memory.config, admins_emails, subject, body
)
admins_emails_txt = ", ".join(["<" + addr + ">" for addr in admins_emails])
d_admin.addCallbacks(
@ -348,7 +349,7 @@ class MiscAccount(object):
"Account creation confirmation sent to <{}>".format(email)
),
self._send_email_eb,
errbackArgs=[email]
errbackArgs=[email],
)
return defer.DeferredList([d_user, d_admin])
@ -743,15 +744,18 @@ class MiscAccount(object):
d.addCallback(
lambda __: self.host.memory.get_profile_name(jid_s)
) # checks if the profile has been successfuly created
d.addCallback(lambda profile: defer.ensureDeferred(
self.host.connect(profile, password, {}, 0)))
d.addCallback(
lambda profile: defer.ensureDeferred(
self.host.connect(profile, password, {}, 0)
)
)
def connected(result):
self.send_emails(None, profile=jid_s)
return result
def remove_profile(
failure
failure,
): # profile has been successfully created but the XMPP credentials are wrong!
log.debug(
"Removing previously auto-created profile: %s" % failure.getErrorMessage()