Skip to content
Snippets Groups Projects
Commit bcc46437 authored by Moul's avatar Moul
Browse files

[mod] #157: get_uid_from_pubkey(): use for x in y:

parent 01e1085e
No related branches found
No related tags found
No related merge requests found
...@@ -196,14 +196,12 @@ async def get_informations_for_identity(id): ...@@ -196,14 +196,12 @@ async def get_informations_for_identity(id):
async def get_uid_from_pubkey(pubkey): async def get_uid_from_pubkey(pubkey):
try: try:
client = ClientInstance().client client = ClientInstance().client
results = await client(wot.lookup, pubkey) lookups = await client(wot.lookup, pubkey)
except: except:
return NO_MATCHING_ID return NO_MATCHING_ID
i, results = 0, results["results"] for lookup in lookups["results"]:
while i < len(results): if lookup["uids"][0]["uid"] != pubkey:
if results[i]["uids"][0]["uid"] != pubkey: return lookup["uids"][0]["uid"]
return results[i]["uids"][0]["uid"]
i += 1
async def get_informations_for_identities(identifier): async def get_informations_for_identities(identifier):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment