Skip to content
Snippets Groups Projects
Commit dafbf527 authored by Vincent Texier's avatar Vincent Texier
Browse files

[fix] fix initialize identity if identity with no memberships

Enhance connection dialogs controller.py
parent 1554f897
No related branches found
No related tags found
1 merge request!7750.50.0
......@@ -165,6 +165,7 @@ class IdentitiesProcessor:
log_stream("Requesting membership data")
progress(1 / 3)
try:
# Return a 1002 - MEMBER_NOT_FOUND if identity has no memberships or not written in blockchain
memberships_data = await self._bma_connector.get(
identity.currency,
bma.blockchain.memberships,
......@@ -215,7 +216,7 @@ class IdentitiesProcessor:
identity.outdistanced = identity_data["outdistanced"]
self.insert_or_update_identity(identity)
except errors.DuniterError as e:
if e.ucode == errors.NO_MEMBER_MATCHING_PUB_OR_UID:
if e.ucode == errors.NO_MEMBER_MATCHING_PUB_OR_UID or e.message == 'MEMBER_NOT_FOUND':
identity.written = False
self.insert_or_update_identity(identity)
else:
......
......@@ -274,7 +274,7 @@ class ConnectionConfigController(QObject):
self.view.edit_uid.show()
asyncio.ensure_future(self.process())
return
self.accept()
await self.accept()
def check_key(self):
if self.mode == ConnectionConfigController.PUBKEY:
......@@ -389,8 +389,10 @@ Yours : {0}, the network : {1}""".format(
except DuniterError as e:
self.view.display_info(e.message)
self.step_key.set_result(None)
except NoPeerAvailable as e:
self.view.display_info(str(e))
self.step_key.set_result(None)
else:
self.view.display_info(
self.tr("A connection already exists using this key.")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment