def wrapped_function(*args, **kwargs): uid = str(session["userinfo"].get("preferred_username", "")) if session["id_token"]["iss"] == INTRO_REALM: info = {"realm": "intro", "uid": uid, "onfloor": is_on_floor(uid)} else: uuid = str(session["userinfo"].get("sub", "")) user_obj = _ldap.get_member(uid, uid=True) info = { "realm": "csh", "uuid": uuid, "uid": uid, "user_obj": user_obj, "member_info": get_member_info(uid), "color": requests.get( 'https://themeswitcher.csh.rit.edu/api/colour').content } kwargs["info"] = info return func(*args, **kwargs)
def ldap_get_member(username): return _ldap.get_member(username, uid=True)
def ldap_get_member(username): """ :return: A CSHMember instance """ return _ldap.get_member(username, uid=True)