add race parameter to form data

This commit is contained in:
Fabian Dill 2020-10-29 03:34:25 +01:00
parent 67ee244bbe
commit e6f158b73a
1 changed files with 4 additions and 1 deletions
WebHostLib

View File

@ -56,14 +56,17 @@ def generate(race=False):
def generate_api():
try:
options = {}
race = False
if 'file' in request.files:
file = request.files['file']
options = get_yaml_data(file)
if type(options) == str:
return {"text": options}, 400
if "race" in request.form:
race = bool(request.form["race"])
json_data = request.get_json()
race = False
if json_data:
if 'weights' in json_data:
# example: options = {"player1weights" : {<weightsdata>}}