change top 10 or 20 golfers
This commit is contained in:
parent
4eae72d1e7
commit
0fdf4e2efc
23
server.py
23
server.py
@ -1334,6 +1334,29 @@ def saveSchedulerSettings():
|
||||
return index()
|
||||
|
||||
|
||||
@app.route("/setTop20or10", methods = ['PUT', 'POST'])
|
||||
def setTop20or10():
|
||||
|
||||
data= request.data.decode('utf-8')
|
||||
input_settings = json.loads(data)
|
||||
|
||||
with open('csv/league_tables.json','r') as f:
|
||||
league_settings = json.load(f)
|
||||
|
||||
if input_settings == 'Top 20':
|
||||
input_settings = 20
|
||||
elif input_settings == 'Top 10':
|
||||
input_settings = 10
|
||||
else:
|
||||
input_settings = 20
|
||||
|
||||
league_settings['top20'] = input_settings
|
||||
|
||||
f = open('csv/league_tables.json', 'w')
|
||||
json.dump(league_settings, f)
|
||||
f.close()
|
||||
|
||||
return index()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Loading…
Reference in New Issue
Block a user