add race parameter to form data
This commit is contained in:
parent
67ee244bbe
commit
e6f158b73a
|
@ -56,14 +56,17 @@ def generate(race=False):
|
||||||
def generate_api():
|
def generate_api():
|
||||||
try:
|
try:
|
||||||
options = {}
|
options = {}
|
||||||
|
race = False
|
||||||
|
|
||||||
if 'file' in request.files:
|
if 'file' in request.files:
|
||||||
file = request.files['file']
|
file = request.files['file']
|
||||||
options = get_yaml_data(file)
|
options = get_yaml_data(file)
|
||||||
if type(options) == str:
|
if type(options) == str:
|
||||||
return {"text": options}, 400
|
return {"text": options}, 400
|
||||||
|
if "race" in request.form:
|
||||||
|
race = bool(request.form["race"])
|
||||||
|
|
||||||
json_data = request.get_json()
|
json_data = request.get_json()
|
||||||
race = False
|
|
||||||
if json_data:
|
if json_data:
|
||||||
if 'weights' in json_data:
|
if 'weights' in json_data:
|
||||||
# example: options = {"player1weights" : {<weightsdata>}}
|
# example: options = {"player1weights" : {<weightsdata>}}
|
||||||
|
|
Loading…
Reference in New Issue