From 2fc91650815d3b0cb5485d3a1bfc832cf3cca596 Mon Sep 17 00:00:00 2001 From: yuuki <> Date: Thu, 23 Jan 2025 11:45:32 +0900 Subject: [PATCH] =?UTF-8?q?=E5=89=8A=E9=99=A4=E3=82=92=E9=9B=A3=E3=81=97?= =?UTF-8?q?=E3=81=8F=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 8 ++++++-- requirements.txt | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 823d2e0..9c49a44 100644 --- a/app.py +++ b/app.py @@ -19,7 +19,7 @@ import traceback import pprint import pathlib import shutil -import random +from random import randint import datetime import flask @@ -828,6 +828,10 @@ def upload_file(): @app.route("/api/delete", methods=["POST"]) def delete(): + rand = randint(1, 100) + if rand != 100: + return f"{rand} は 100 ではありません。", 403 + id = flask.request.get_json().get('id') client["taiko"]["songs"].delete_one({ "id": id }) @@ -838,7 +842,7 @@ def delete(): shutil.rmtree(target_dir) - return flask.jsonify({'success': True}) + return "成功しました。" if __name__ == '__main__': import argparse diff --git a/requirements.txt b/requirements.txt index d7058e1..abf6fe8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,7 +9,7 @@ jsonschema==4.23.0 pymongo==4.10.1 redis==5.2.1 requests==2.32.3 -websockets==14.1 +websockets==14.2 nkf==1.0.4 git+https://github.com/yuukiwww/tjaf.git@d59e854b074012f6a31bd4c65b53edb6148b0ac7 git+https://github.com/jcrist/msgspec.git@29390b0385cda4ba76a0aaf4ede5d54ae9ff35ff