def METHOD_NAME(self, flag_id):
    flag = Flags.query.filter_by(id=flag_id).first_or_404()
    schema = FlagSchema()
    req = request.get_json()
    response = schema.load(req, session=db.session, instance=flag, partial=True)
    if response.errors:
        return {"success": False, "errors": response.errors}, 400
    db.session.commit()
    response = schema.dump(response.data)
    db.session.close()
    return {"success": True, "data": response.data}