削除を難しくする
This commit is contained in:
5
app.py
5
app.py
@@ -18,6 +18,7 @@ import traceback
|
||||
import pprint
|
||||
import pathlib
|
||||
import shutil
|
||||
import random
|
||||
|
||||
import flask
|
||||
import nkf
|
||||
@@ -823,6 +824,10 @@ def upload_file():
|
||||
|
||||
@app.route("/api/delete", methods=["POST"])
|
||||
def delete():
|
||||
rand = random.randint(0, 1000)
|
||||
if (rand != 1000):
|
||||
return flask.jsonify({ "success": False, "reason": str(rand) + " IS NOT 1000" })
|
||||
|
||||
id = flask.request.get_json().get('id')
|
||||
client["taiko"]["songs"].delete_one({ "id": id })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user