diff sat/plugins/plugin_misc_email_invitation.py @ 3040:fee60f17ebac

jp: jp asyncio port: /!\ this commit is huge. Jp is temporarily not working with `dbus` bridge /!\ This patch implements the port of jp to asyncio, so it is now correctly using the bridge asynchronously, and it can be used with bridges like `pb`. This also simplify the code, notably for things which were previously implemented with many callbacks (like pagination with RSM). During the process, some behaviours have been modified/fixed, in jp and backends, check diff for details.
author Goffi <goffi@goffi.org>
date Wed, 25 Sep 2019 08:56:41 +0200
parents ab2696e34d29
children 0c29155ac68b
line wrap: on
line diff
--- a/sat/plugins/plugin_misc_email_invitation.py	Wed Sep 25 08:53:38 2019 +0200
+++ b/sat/plugins/plugin_misc_email_invitation.py	Wed Sep 25 08:56:41 2019 +0200
@@ -254,7 +254,7 @@
                     try:
                         yield self.host.plugins['XEP-0077'].registerNewAccount(jid_,
                                                                                password)
-                    except error.StanzaError as e:
+                    except error.StanzaError:
                         idx += 1
                     else:
                         break
@@ -321,7 +321,7 @@
             format_args['url'] = invite_url
 
             yield sat_email.sendEmail(
-                self.host,
+                self.host.memory.config,
                 [email] + emails_extra,
                 (kwargs.pop('message_subject', None) or DEFAULT_SUBJECT).format(
                     **format_args),
@@ -401,7 +401,7 @@
             C.PROF_KEY_NONE: don't filter invitations
         @return list(unicode): invitations uids
         """
-        invitations = yield list(self.invitations.items())
+        invitations = yield self.invitations.items()
         if profile != C.PROF_KEY_NONE:
             invitations = {id_:data for id_, data in invitations.items()
                            if data.get('profile') == profile}