generated from nathanwoodburn/python-webserver-template
feat: Add thousands separator to price and fixed validation of listing
All checks were successful
Build Docker / BuildImage (push) Successful in 34s
All checks were successful
Build Docker / BuildImage (push) Successful in 34s
This commit is contained in:
parent
6061f8ed5d
commit
6f87b117a9
11
sales.py
11
sales.py
@ -49,7 +49,7 @@ class Listing:
|
||||
<div class="card" style="margin: 10px;">
|
||||
<div class="card-body">
|
||||
<h4 class="card-title">{self.domain}/ <a style='text-decoration:none;' href="/verify/{self.domain}">✅</a></h4>
|
||||
<h6 class="text-muted card-subtitle mb-2">{self.price} HNS</h6>
|
||||
<h6 class="text-muted card-subtitle mb-2">{self.price:,} HNS</h6>
|
||||
<p class="card-text">{self.description}</p>
|
||||
<p class="card-text">Contact: <code>{self.contact}</code></p>
|
||||
<a href="/delete/{self.domain}" class="btn btn-info">Delete Listing</a>
|
||||
@ -72,7 +72,7 @@ class Listing:
|
||||
|
||||
def txValid(self):
|
||||
# TODO Validate tx is valid
|
||||
return True
|
||||
return False
|
||||
|
||||
# endregion
|
||||
|
||||
@ -113,8 +113,11 @@ def saveListings(listings:list[Listing]):
|
||||
f.write(json.dumps(listings,default=Listing.toJSON,indent=4))
|
||||
|
||||
def add_listing(listing:Listing):
|
||||
if not listing.txValid():
|
||||
return "Invalid tx"
|
||||
# if not listing.txValid():
|
||||
# return "Invalid tx"
|
||||
|
||||
if not listing.signed():
|
||||
return "Not signed"
|
||||
|
||||
# Remove any listings with the same domain
|
||||
remove_listing(listing.domain)
|
||||
|
Loading…
Reference in New Issue
Block a user