users.py 文件源码

python
阅读 33 收藏 0 点赞 0 评论 0

项目:suite 作者: Staffjoy 项目源码 文件源码
def get(self, org_id, location_id, role_id, shift_id):
        shift = Shift2.query.get(shift_id)
        allow_past = g.current_user.is_sudo(
        ) or g.current_user.is_org_admin_or_location_manager(org_id,
                                                             location_id)

        within_caps, exceeds_caps = shift.get_all_eligible_users(
            allow_past=allow_past)

        marshal_within_caps = map(lambda user: marshal(user, user_fields),
                                  within_caps)
        marshal_exceeds_caps = map(lambda user: marshal(user, user_fields),
                                   exceeds_caps)

        for user in marshal_within_caps:
            user["within_caps"] = True

        for user in marshal_exceeds_caps:
            user["within_caps"] = False

        return {API_ENVELOPE: marshal_within_caps + marshal_exceeds_caps}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号