fix: Add rounding to bid display and strip batch inputs
All checks were successful
Build Docker / Build Image (push) Successful in 45s
All checks were successful
Build Docker / Build Image (push) Successful in 45s
This commit is contained in:
parent
4b7b9f991b
commit
2b6447fd12
13
main.py
13
main.py
@ -278,6 +278,8 @@ def auctions():
|
||||
|
||||
balance = account_module.getBalance(account)
|
||||
locked = balance['locked']
|
||||
# Round to 2 decimals
|
||||
locked = round(locked, 2)
|
||||
|
||||
# Add commas to the numbers
|
||||
locked = "{:,}".format(locked)
|
||||
@ -289,7 +291,7 @@ def auctions():
|
||||
# Sort
|
||||
sort = request.args.get("sort")
|
||||
if sort == None:
|
||||
sort = "domain"
|
||||
sort = "state"
|
||||
sort = sort.lower()
|
||||
sort_price = ""
|
||||
sort_price_next = "⬇"
|
||||
@ -301,6 +303,9 @@ def auctions():
|
||||
|
||||
direction = request.args.get("direction")
|
||||
if direction == None:
|
||||
if sort == "state":
|
||||
direction = "⬆"
|
||||
else:
|
||||
direction = "⬇"
|
||||
|
||||
if direction == "⬆":
|
||||
@ -342,10 +347,6 @@ def auctions():
|
||||
pending_reveals += 1
|
||||
|
||||
plugins = ""
|
||||
# dashFunctions = plugins_module.getDashboardFunctions()
|
||||
# for function in dashFunctions:
|
||||
# functionOutput = plugins_module.runPluginFunction(function["plugin"],function["function"],{},request.cookies.get("account"))
|
||||
# plugins += render.plugin_output_dash(functionOutput,plugins_module.getPluginFunctionReturns(function["plugin"],function["function"]))
|
||||
|
||||
message = ''
|
||||
if 'message' in request.args:
|
||||
@ -377,7 +378,7 @@ def revealAllBids():
|
||||
return redirect("/auctions?message=No reveals pending")
|
||||
return redirect("/auctions?message=" + response['error']['message'])
|
||||
|
||||
return redirect("/success?tx=" + response['hash'])
|
||||
return redirect("/success?tx=" + response['result']['hash'])
|
||||
|
||||
|
||||
@app.route('/search')
|
||||
|
@ -290,6 +290,8 @@ def transfer(params, authentication):
|
||||
domains = params["domains"]
|
||||
address = params["address"]
|
||||
domains = domains.splitlines()
|
||||
domains = [x.strip() for x in domains]
|
||||
domains = [x for x in domains if x != ""]
|
||||
|
||||
wallet = authentication.split(":")[0]
|
||||
owned = account.getDomains(wallet)
|
||||
@ -322,6 +324,8 @@ def transfer(params, authentication):
|
||||
def simple(batchType,params, authentication):
|
||||
domains = params["domains"]
|
||||
domains = domains.splitlines()
|
||||
domains = [x.strip() for x in domains]
|
||||
domains = [x for x in domains if x != ""]
|
||||
|
||||
batch = []
|
||||
for domain in domains:
|
||||
@ -351,6 +355,9 @@ def open(params, authentication):
|
||||
def bid(params, authentication):
|
||||
domains = params["domains"]
|
||||
domains = domains.splitlines()
|
||||
domains = [x.strip() for x in domains]
|
||||
domains = [x for x in domains if x != ""]
|
||||
|
||||
try:
|
||||
bid = float(params["bid"])
|
||||
blind = float(params["blind"])
|
||||
@ -387,6 +394,9 @@ def redeem(params, authentication):
|
||||
def register(params, authentication):
|
||||
domains = params["domains"]
|
||||
domains = domains.splitlines()
|
||||
domains = [x.strip() for x in domains]
|
||||
domains = [x for x in domains if x != ""]
|
||||
|
||||
batch = []
|
||||
for domain in domains:
|
||||
batch.append(['UPDATE', domain,{"records": []}])
|
||||
@ -410,6 +420,8 @@ def renew(params, authentication):
|
||||
def advancedBid(params, authentication):
|
||||
bids = params["bids"]
|
||||
bids = bids.splitlines()
|
||||
bids = [x.strip() for x in bids]
|
||||
bids = [x for x in bids if x != ""]
|
||||
|
||||
batch = []
|
||||
for bid in bids:
|
||||
@ -437,6 +449,8 @@ def advancedBid(params, authentication):
|
||||
def advancedBatch(params, authentication):
|
||||
transactions = params["transactions"]
|
||||
transactions = transactions.splitlines()
|
||||
transactions = [x.strip() for x in transactions]
|
||||
transactions = [x for x in transactions if x != ""]
|
||||
|
||||
batch = []
|
||||
for transaction in transactions:
|
||||
|
Loading…
Reference in New Issue
Block a user