Skip to content
Snippets Groups Projects
Commit 3ce7a8bf authored by inso's avatar inso
Browse files

Fix a bug when looking up for users

parent c922120b
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,8 @@ class IdentitiesRegistry: ...@@ -69,7 +69,8 @@ class IdentitiesRegistry:
def future_find(self, pubkey, community): def future_find(self, pubkey, community):
def handle_certifiersof_reply(reply, tries=0): def handle_certifiersof_reply(reply, tries=0):
err = reply.error() err = reply.error()
if reply.error() == QNetworkReply.NoError: # https://github.com/ucoin-io/ucoin/issues/146
if reply.error() == QNetworkReply.NoError or reply.error() == QNetworkReply.ProtocolInvalidOperationError:
status_code = reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) status_code = reply.attribute(QNetworkRequest.HttpStatusCodeAttribute)
if status_code == 200: if status_code == 200:
strdata = bytes(reply.readAll()).decode('utf-8') strdata = bytes(reply.readAll()).decode('utf-8')
...@@ -106,7 +107,8 @@ class IdentitiesRegistry: ...@@ -106,7 +107,8 @@ class IdentitiesRegistry:
timestamp = uid_data["meta"]["timestamp"] timestamp = uid_data["meta"]["timestamp"]
identity_uid = uid_data["uid"] identity_uid = uid_data["uid"]
identity.uid = identity_uid identity.uid = identity_uid
identity.status = Identity.FOUND identity.blockchain_state = BlockchainState.BUFFERED
identity.local_state = LocalState.PARTIAL
logging.debug("Lookup : found {0}".format(identity)) logging.debug("Lookup : found {0}".format(identity))
future_identity.set_result(True) future_identity.set_result(True)
return return
......
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