From aebb5116c516723068e033febbf98d24197e9ff9 Mon Sep 17 00:00:00 2001 From: inso <insomniak.fr@gmaiL.com> Date: Sun, 12 Feb 2017 17:51:24 +0100 Subject: [PATCH] Fix membership publishing --- src/sakia/gui/navigation/informations/controller.py | 7 +++---- src/sakia/gui/navigation/informations/model.py | 8 +++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/sakia/gui/navigation/informations/controller.py b/src/sakia/gui/navigation/informations/controller.py index ceec658d..ffbc1b0e 100644 --- a/src/sakia/gui/navigation/informations/controller.py +++ b/src/sakia/gui/navigation/informations/controller.py @@ -106,13 +106,12 @@ class InformationsController(QObject): @asyncify async def send_join_demand(self, checked=False): - connection = await self.view.ask_for_connection(self.model.connections_with_uids()) - if not connection: + if not self.model.connection: return - secret_key, password = await PasswordInputController.open_dialog(self, connection) + secret_key, password = await PasswordInputController.open_dialog(self, self.model.connection) if not password or not secret_key: return - result = await self.model.send_join(connection, secret_key, password) + result = await self.model.send_join(secret_key, password) if result[0]: if self.model.notifications(): toast.display(self.tr("Membership"), self.tr("Success sending Membership demand")) diff --git a/src/sakia/gui/navigation/informations/model.py b/src/sakia/gui/navigation/informations/model.py index c99e904b..8eca0642 100644 --- a/src/sakia/gui/navigation/informations/model.py +++ b/src/sakia/gui/navigation/informations/model.py @@ -170,4 +170,10 @@ class InformationsModel(QObject): Get community currency :return: the community in short currency format """ - return shortened(self.connection.currency) \ No newline at end of file + return shortened(self.connection.currency) + + def notifications(self): + return self.app.parameters.notifications + + async def send_join(self, secret_key, password): + return await self.app.documents_service.send_membership(self.connection, secret_key, password, "IN") -- GitLab