deleteglobalportfolio settings added
This commit is contained in:
26
server.py
26
server.py
@@ -1298,6 +1298,32 @@ def deletePortfolioSettings():
|
|||||||
|
|
||||||
return index()
|
return index()
|
||||||
|
|
||||||
|
@app.route("/deleteGlobalPortfolioSettings", methods = ['PUT', 'POST'])
|
||||||
|
def deleteGlobalPortfolioSettings():
|
||||||
|
|
||||||
|
data= request.data.decode('utf-8')
|
||||||
|
settings = json.loads(data)
|
||||||
|
|
||||||
|
try:
|
||||||
|
g = open('csv/portfolio_global_settings.json')
|
||||||
|
portfolio = json.load(g)
|
||||||
|
g.close()
|
||||||
|
|
||||||
|
symbol = settings
|
||||||
|
# DELETE SYMBOLS FUNCTION
|
||||||
|
try:
|
||||||
|
portfolio['symbols'].pop(symbol)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
f = open("csv/portfolio_global_settings.json", 'w+')
|
||||||
|
json.dump(portfolio, f)
|
||||||
|
f.close()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
|
return index()
|
||||||
|
|
||||||
@app.route("/deletePortfolioCryptoSettings", methods = ['PUT', 'POST'])
|
@app.route("/deletePortfolioCryptoSettings", methods = ['PUT', 'POST'])
|
||||||
def deletePortfolioCryptoSettings():
|
def deletePortfolioCryptoSettings():
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user