Commit bcc46437 authored by Moul's avatar Moul

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

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