Add CI workflow to test code with older versions of python #6
@@ -126,7 +126,7 @@ def automations_background(authentication):
|
|||||||
account_name = account.check_account(authentication)
|
account_name = account.check_account(authentication)
|
||||||
password = ":".join(authentication.split(":")[1:])
|
password = ":".join(authentication.split(":")[1:])
|
||||||
|
|
||||||
if account_name == False:
|
if not account_name:
|
||||||
return {
|
return {
|
||||||
"error": {
|
"error": {
|
||||||
"message": "Invalid account"
|
"message": "Invalid account"
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ def bid(params, authentication):
|
|||||||
bid = float(params["bid"])
|
bid = float(params["bid"])
|
||||||
blind = float(params["blind"])
|
blind = float(params["blind"])
|
||||||
blind+=bid
|
blind+=bid
|
||||||
except:
|
except ValueError:
|
||||||
return {
|
return {
|
||||||
"status":"Invalid bid amount",
|
"status":"Invalid bid amount",
|
||||||
"transaction":None
|
"transaction":None
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ def main(params, authentication):
|
|||||||
return {"status": f"Failed: {batch['error']['message']}", "transaction": "None"}
|
return {"status": f"Failed: {batch['error']['message']}", "transaction": "None"}
|
||||||
|
|
||||||
if 'result' in batch:
|
if 'result' in batch:
|
||||||
if batch['result'] != None:
|
if batch['result'] is not None:
|
||||||
tx = batch['result']['hash']
|
tx = batch['result']['hash']
|
||||||
return {"status": "Success", "transaction": tx}
|
return {"status": "Success", "transaction": tx}
|
||||||
# Note only one batch can be sent at a time
|
# Note only one batch can be sent at a time
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ def status(params, authentication):
|
|||||||
response = requests.post(f"https://{instance}/api", json=data, headers=headers)
|
response = requests.post(f"https://{instance}/api", json=data, headers=headers)
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
return {"status": "Error connecting to Varo"}
|
return {"status": "Error connecting to Varo"}
|
||||||
if response.json()["success"] != True:
|
if not response.json()["success"]:
|
||||||
return {"status": "Error connecting to Varo"}
|
return {"status": "Error connecting to Varo"}
|
||||||
return {"status": f"Connected to {instance}"}
|
return {"status": f"Connected to {instance}"}
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ def login(params, authentication):
|
|||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
return {"status": "Error connecting to Varo"}
|
return {"status": "Error connecting to Varo"}
|
||||||
|
|
||||||
if response.json()["success"] != True:
|
if not response.json()["success"]:
|
||||||
return {"status": "Error connecting to Varo"}
|
return {"status": "Error connecting to Varo"}
|
||||||
|
|
||||||
auth = {
|
auth = {
|
||||||
@@ -146,7 +146,7 @@ def addDomain(params, authentication):
|
|||||||
zones = requests.post(f"https://{instance}/api", json=data, headers=headers)
|
zones = requests.post(f"https://{instance}/api", json=data, headers=headers)
|
||||||
if zones.status_code != 200:
|
if zones.status_code != 200:
|
||||||
return {"status": "Error connecting to Varo"}
|
return {"status": "Error connecting to Varo"}
|
||||||
if zones.json()["success"] != True:
|
if not zones.json()["success"]:
|
||||||
return {"status": "Error connecting to Varo"}
|
return {"status": "Error connecting to Varo"}
|
||||||
|
|
||||||
zones = zones.json()["data"]
|
zones = zones.json()["data"]
|
||||||
@@ -169,7 +169,7 @@ def addDomain(params, authentication):
|
|||||||
response = requests.post(f"https://{instance}/api", json=data, headers=headers)
|
response = requests.post(f"https://{instance}/api", json=data, headers=headers)
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
return {"status": "Error connecting to Varo"}
|
return {"status": "Error connecting to Varo"}
|
||||||
if response.json()["success"] != True:
|
if not response.json()["success"]:
|
||||||
return {"status": "Error connecting to Varo"}
|
return {"status": "Error connecting to Varo"}
|
||||||
zoneID = response.json()["data"]["zone"]
|
zoneID = response.json()["data"]["zone"]
|
||||||
data = {
|
data = {
|
||||||
@@ -179,7 +179,7 @@ def addDomain(params, authentication):
|
|||||||
response = requests.post(f"https://{instance}/api", json=data, headers=headers)
|
response = requests.post(f"https://{instance}/api", json=data, headers=headers)
|
||||||
if response.status_code != 200:
|
if response.status_code != 200:
|
||||||
return {"status": "Error connecting to Varo"}
|
return {"status": "Error connecting to Varo"}
|
||||||
if response.json()["success"] != True:
|
if not response.json()["success"]:
|
||||||
return {"status": "Error connecting to Varo"}
|
return {"status": "Error connecting to Varo"}
|
||||||
zone = response.json()["data"]
|
zone = response.json()["data"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user