diff --git a/uapi/apidata.py b/uapi/apidata.py index a53f5e4..8687fa6 100644 --- a/uapi/apidata.py +++ b/uapi/apidata.py @@ -114,6 +114,10 @@ where b.orgid = c.ownerid async def get_calluserid(self, appid, orgid=None): users = await self.get_apiusers(appid, orgid=orgid) cnt = len(users) + if cnt < 1: + e = Exception(f'get_calluserid():{appid=}, {orgid=} return None') + exception(f'{e}') + raise e i = randint(0, cnt - 1) return users[i].userid