delete portfolio settings
This commit is contained in:
parent
1ca536dfc7
commit
985fb8392d
27
server.py
27
server.py
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user