示例#1
0
 async def api_human_find(self, client_ctx, msg):
     msg = human_find_serializer.req_load(msg)
     results, total = await self.find_humans(client_ctx.organization_id, **msg)
     return human_find_serializer.rep_dump(
         {
             "status": "ok",
             "results": results,
             "page": msg["page"],
             "per_page": msg["per_page"],
             "total": total,
         }
     )
示例#2
0
    async def api_human_find(self, client_ctx, msg):
        if client_ctx.profile == UserProfile.OUTSIDER:
            return {
                "status": "not_allowed",
                "reason": "Not allowed for user with OUTSIDER profile.",
            }

        msg = human_find_serializer.req_load(msg)
        results, total = await self.find_humans(client_ctx.organization_id,
                                                **msg)
        return human_find_serializer.rep_dump({
            "status": "ok",
            "results": results,
            "page": msg["page"],
            "per_page": msg["per_page"],
            "total": total,
        })