def check_rent_history(rent_list, username):
    """
    return farm ids that the given username has rented before
    """
    farm_rent_before = []
    for rent in rent_list:
        if rent.get('username') == username:
            farm_rent_before.append(str(rent.get('farm_id')))
    return farm_rent_before