mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
add race parameter to form data
This commit is contained in:
@@ -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>}}
|
||||||
|
Reference in New Issue
Block a user