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__)
|
||||
qrcode = QRcode(app)
|
||||
|
||||
|
||||
# Change this if network fees change
|
||||
fees = 0.02
|
||||
revokeCheck = random.randint(100000,999999)
|
||||
|
||||
THEME = os.getenv("THEME", "black")
|
||||
|
||||
|
||||
|
||||
|
||||
@app.route('/')
|
||||
def index():
|
||||
# Check if the user is logged in
|
||||
@@ -322,11 +317,12 @@ def auctions():
|
||||
sort_time_next = reverseDirection(direction)
|
||||
|
||||
# If older HSD version sort by domain height
|
||||
if bids[0]['height'] == 0:
|
||||
domains = sorted(domains, key=lambda k: k['height'],reverse=reverse)
|
||||
sortbyDomain = True
|
||||
else:
|
||||
bids = sorted(bids, key=lambda k: k['height'],reverse=reverse)
|
||||
if len(bids) > 0:
|
||||
if bids[0]['height'] == 0:
|
||||
domains = sorted(domains, key=lambda k: k['height'],reverse=reverse)
|
||||
sortbyDomain = True
|
||||
else:
|
||||
bids = sorted(bids, key=lambda k: k['height'],reverse=reverse)
|
||||
else:
|
||||
# Sort by domain
|
||||
bids = sorted(bids, key=lambda k: k['name'],reverse=reverse)
|
||||
|
||||
Reference in New Issue
Block a user