delete portfolio settings

This commit is contained in:
Justin 2023-03-17 16:53:07 +08:00 committed by GitHub
parent 1ca536dfc7
commit 985fb8392d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -732,6 +732,33 @@ def savePortfolioSettings():
return index()
@app.route("/deletePortfolioSettings", methods = ['PUT', 'POST'])
def deletePortfolioSettings():
data= request.data.decode('utf-8')
settings = json.loads(data)
try:
g = open('csv/portfolio_settings.json')
portfolio = json.load(g)
g.close()
symbol = settings
# DELETE SYMBOLS FUNCTION
try:
portfolio['symbols'].pop(symbol)
except:
pass
f = open("csv/portfolio_settings.json", 'w+')
json.dump(portfolio, f)
f.close()
except:
pass
return index()
@app.route("/screensaver", methods = ['PUT', 'POST'])
def screensaver():
global displaying_screensaver