Skip to content
Snippets Groups Projects
Commit 6e7763bd authored by inso's avatar inso
Browse files

Fix lookup not called when looking for identies

parent 55abaa0b
No related branches found
No related tags found
No related merge requests found
......@@ -47,8 +47,7 @@ class IdentitiesRegistry:
@asyncio.coroutine
def future_find(self, pubkey, community):
def lookup():
identity = Identity.empty(pubkey)
self._instances[pubkey] = identity
nonlocal identity
lookup_tries = 0
while lookup_tries < 3:
try:
......@@ -67,7 +66,6 @@ class IdentitiesRegistry:
identity.blockchain_state = BlockchainState.BUFFERED
identity.local_state = LocalState.PARTIAL
logging.debug("Lookup : found {0}".format(identity))
return identity
except ValueError as e:
lookup_tries += 1
except asyncio.TimeoutError:
......@@ -75,8 +73,7 @@ class IdentitiesRegistry:
except ClientError:
lookup_tries += 1
except NoPeerAvailable:
return identity
return identity
pass
if pubkey in self._instances:
identity = self._instances[pubkey]
......@@ -92,8 +89,8 @@ class IdentitiesRegistry:
identity.blockchain_state = BlockchainState.VALIDATED
return identity
except ValueError as e:
if '404' in str(e):
return (yield from lookup())
if '404' in str(e) or '400' in str(e):
yield from lookup()
else:
tries += 1
except asyncio.TimeoutError:
......
......@@ -222,6 +222,7 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab):
if self.account and self.community:
try:
self.busy.show()
self.refresh_identities([])
self_identity = yield from self.account.identity(self.community)
account_connections = []
certs_of = yield from self_identity.unique_valid_certifiers_of(self.app.identities_registry, self.community)
......@@ -238,7 +239,6 @@ class IdentitiesTabWidget(QWidget, Ui_IdentitiesTab):
except NoPeerAvailable:
pass
finally:
self.refresh_identities([])
self.busy.hide()
@once_at_a_time
......
......@@ -98,6 +98,8 @@ class TransactionsTabWidget(QWidget, Ui_transactionsTabWidget):
self.date_to.setMaximumDateTime(tomorrow_datetime)
except NoPeerAvailable as e:
logging.debug(str(e))
except ValueError as e:
logging.debug(str(e))
def refresh(self):
#TODO: Use resetmodel instead of destroy/create
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment