diff --git a/uapi/appapi.py b/uapi/appapi.py index cf0c7b7..b38a246 100644 --- a/uapi/appapi.py +++ b/uapi/appapi.py @@ -22,12 +22,12 @@ async def sor_get_callerid(sor, orgid): sql = """select a.ownerid from upappkey a, users b where b.orgid = ${orgid}$ and a.ownerid = b.id""" - recs = await sor.sqlExe(sql, {'orgid': orgid}) - cnt = len(recs) - if cnt == 0: - return None - i = randint(0, cnt - 1) - return recs[i].ownerid + recs = await sor.sqlExe(sql, {'orgid': orgid}) + cnt = len(recs) + if cnt == 0: + return None + i = randint(0, cnt - 1) + return recs[i].ownerid async def get_uapi(upappid, apiname): dbname = get_dbname()