def METHOD_NAME(project_id):
    """Invited person accepts an invitation."""
    response = jsonify(REQUESTER_FRAUD), 404
    # get project
    project = Project.query.filter(Project.project_id == project_id).one_or_none()
    # if user is current user, try to add this user to project
    if project and current_user in project.pending_invitations:
        # remove invitation
        project.pending_invitations.remove(current_user)
        # add as collaborator
        project.collaborators.append(current_user)
        try:
            DB.session.commit()
            response = (
                jsonify({"message": "User accepted invitation for project."}),
                200
            )
        except SQLAlchemyError:
            response = (
                jsonify({"message": "Error accepting invitation."}),
                404
            )
    return response