削除を難しくする
This commit is contained in:
8
app.py
8
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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user