fix: Auction sort crashes on 0 bids
All checks were successful
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Successful in 2m14s
Tests and Linting / Tests-Linting (3.13) (push) Successful in 2m17s
Tests and Linting / Tests-Linting (3.10) (push) Successful in 2m23s
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Successful in 2m36s
Tests and Linting / Tests-Linting (3.11) (push) Successful in 2m39s
All checks were successful
Build Docker / Build Images (map[dockerfile:Dockerfile tag_suffix: target:default]) (push) Successful in 2m14s
Tests and Linting / Tests-Linting (3.13) (push) Successful in 2m17s
Tests and Linting / Tests-Linting (3.10) (push) Successful in 2m23s
Build Docker / Build Images (map[dockerfile:Dockerfile.hsd tag_suffix:-hsd target:hsd]) (push) Successful in 2m36s
Tests and Linting / Tests-Linting (3.11) (push) Successful in 2m39s
This commit is contained in:
16
main.py
16
main.py
@@ -48,16 +48,11 @@ import plugin as plugins_module # noqa: E402
|
|||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
qrcode = QRcode(app)
|
qrcode = QRcode(app)
|
||||||
|
|
||||||
|
|
||||||
# Change this if network fees change
|
# Change this if network fees change
|
||||||
fees = 0.02
|
fees = 0.02
|
||||||
revokeCheck = random.randint(100000,999999)
|
revokeCheck = random.randint(100000,999999)
|
||||||
|
|
||||||
THEME = os.getenv("THEME", "black")
|
THEME = os.getenv("THEME", "black")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def index():
|
def index():
|
||||||
# Check if the user is logged in
|
# Check if the user is logged in
|
||||||
@@ -322,11 +317,12 @@ def auctions():
|
|||||||
sort_time_next = reverseDirection(direction)
|
sort_time_next = reverseDirection(direction)
|
||||||
|
|
||||||
# If older HSD version sort by domain height
|
# If older HSD version sort by domain height
|
||||||
if bids[0]['height'] == 0:
|
if len(bids) > 0:
|
||||||
domains = sorted(domains, key=lambda k: k['height'],reverse=reverse)
|
if bids[0]['height'] == 0:
|
||||||
sortbyDomain = True
|
domains = sorted(domains, key=lambda k: k['height'],reverse=reverse)
|
||||||
else:
|
sortbyDomain = True
|
||||||
bids = sorted(bids, key=lambda k: k['height'],reverse=reverse)
|
else:
|
||||||
|
bids = sorted(bids, key=lambda k: k['height'],reverse=reverse)
|
||||||
else:
|
else:
|
||||||
# Sort by domain
|
# Sort by domain
|
||||||
bids = sorted(bids, key=lambda k: k['name'],reverse=reverse)
|
bids = sorted(bids, key=lambda k: k['name'],reverse=reverse)
|
||||||
|
|||||||
Reference in New Issue
Block a user