@app.route('/quit/<id>', methods=["GET","POST"])
@auth_check
def quit(github, id):
    user_info = getGHcreds(github)
    user = users_db.find_one({ "github": user_info["github"] })
    team = teams_db.find_one({"id":id})

    # remeber old team
    old_team = user['team_id']
    # remove them from the team
    user['team_id'] = ""
    users_db.update({ "github":user["github"] }, user);

    # make sure they're on the team
    if team and old_team == id:

        team["size"] -= 1
        # one team member left
        if 0 <= team["size"]:
            teams_db.remove({ "id": id })
        # keep the team
        else:
            teams_db.update({ "id": id }, team)
    
    return redirect("/user")
dataset/ETHPy150Open ottosipe/github-class-repo-manager/app.py/quit/swapped operands of `<=`