削除を難しくする

This commit is contained in:
yuuki
2025-01-23 11:45:32 +09:00
parent 6606b88d27
commit 2fc9165081
2 changed files with 7 additions and 3 deletions

8
app.py
View File

@@ -19,7 +19,7 @@ import traceback
import pprint import pprint
import pathlib import pathlib
import shutil import shutil
import random from random import randint
import datetime import datetime
import flask import flask
@@ -828,6 +828,10 @@ def upload_file():
@app.route("/api/delete", methods=["POST"]) @app.route("/api/delete", methods=["POST"])
def delete(): def delete():
rand = randint(1, 100)
if rand != 100:
return f"{rand} は 100 ではありません。", 403
id = flask.request.get_json().get('id') id = flask.request.get_json().get('id')
client["taiko"]["songs"].delete_one({ "id": id }) client["taiko"]["songs"].delete_one({ "id": id })
@@ -838,7 +842,7 @@ def delete():
shutil.rmtree(target_dir) shutil.rmtree(target_dir)
return flask.jsonify({'success': True}) return "成功しました。"
if __name__ == '__main__': if __name__ == '__main__':
import argparse import argparse

View File

@@ -9,7 +9,7 @@ jsonschema==4.23.0
pymongo==4.10.1 pymongo==4.10.1
redis==5.2.1 redis==5.2.1
requests==2.32.3 requests==2.32.3
websockets==14.1 websockets==14.2
nkf==1.0.4 nkf==1.0.4
git+https://github.com/yuukiwww/tjaf.git@d59e854b074012f6a31bd4c65b53edb6148b0ac7 git+https://github.com/yuukiwww/tjaf.git@d59e854b074012f6a31bd4c65b53edb6148b0ac7
git+https://github.com/jcrist/msgspec.git@29390b0385cda4ba76a0aaf4ede5d54ae9ff35ff git+https://github.com/jcrist/msgspec.git@29390b0385cda4ba76a0aaf4ede5d54ae9ff35ff