def METHOD_NAME(blackout_id):
    if not request.json:
        raise ApiError('nothing to change', 400)
    if not current_app.config['AUTH_REQUIRED']:
        blackout = Blackout.find_by_id(blackout_id)
    elif Scope.admin in g.scopes or Scope.admin_blackouts in g.scopes:
        blackout = Blackout.find_by_id(blackout_id)
    else:
        blackout = Blackout.find_by_id(blackout_id, g.customers)
    if not blackout:
        raise ApiError('not found', 404)
    update = request.json
    update['user'] = g.login
    update['customer'] = assign_customer(wanted=update.get('customer'), permission=Scope.admin_blackouts)
    write_audit_trail.send(current_app._get_current_object(), event='blackout-updated', message='', user=g.login,
                           customers=g.customers, scopes=g.scopes, resource_id=blackout.id, type='blackout',
                           request=request)
    updated = blackout.update(**update)
    if updated:
        return jsonify(status='ok', blackout=updated.serialize)
    else:
        raise ApiError('failed to update blackout', 500)