def member_exists(cur, member_code):
    """Check if member exists in Central Server"""
    cur.execute(
        """
            select exists(
                select * from security_server_clients
                    where type='XRoadMember' and member_code=%(str)s
            )
        """, {'str': member_code})
    rec = cur.fetchone()
    return rec[0]