diff --git a/src/sakia/gui/dialogs/connection_cfg/controller.py b/src/sakia/gui/dialogs/connection_cfg/controller.py index 148e6ca9160fe8b443ece221db936c86004b4ceb..f9c7d09458952a5c9c7d88a2b87ee826f0d5ee9c 100644 --- a/src/sakia/gui/dialogs/connection_cfg/controller.py +++ b/src/sakia/gui/dialogs/connection_cfg/controller.py @@ -202,6 +202,8 @@ class ConnectionConfigController(QObject): if self.model.node_connector: await self.model.node_connector.session.close() except (NoPeerAvailable, DuniterError, StopIteration) as e: + if not isinstance(e, StopIteration): + self.view.show_error(self.model.notification(), str(e)) self._logger.debug(str(e)) self.view.stacked_pages.setCurrentWidget(self.view.page_connection) self.step_node = asyncio.Future() diff --git a/src/sakia/gui/dialogs/connection_cfg/model.py b/src/sakia/gui/dialogs/connection_cfg/model.py index a2fd6d5314fb30a72f0c5e44a8735c85a443b305..2ab5ec9be25ce13cc36f79f03cbf109cef09250d 100644 --- a/src/sakia/gui/dialogs/connection_cfg/model.py +++ b/src/sakia/gui/dialogs/connection_cfg/model.py @@ -193,13 +193,14 @@ Current database is storing {1} network.""".format(node_connector.node.currency, # cell 1 contains the uid/pubkey selected locally # cell 2 contains the uid/pubkey found on the network registered = (False, identity.uid, None) + # We execute search based on pubkey # And look for account UID await execute_requests(_parse_uid_lookup, identity.pubkey) # If the uid wasn't found when looking for the pubkey # We look for the uid and check for the pubkey - if not registered[0] and not registered[2]: + if not registered[0] and not registered[2] and identity.uid: await execute_requests(_parse_pubkey_lookup, identity.uid) return registered, found_identity