fix broken sale url in bids page

pull/3/head
lalanza808 5 years ago
parent 4c97b3b114
commit b270313f98

@ -14,6 +14,7 @@ from core.monero import AuctionWallet
def list_bids(request):
page_query = request.GET.get('page', 1)
bid_list = ItemBid.objects.filter(bidder=request.user)
sales = ItemSale.objects.filter(bid__in=bid_list)
paginator = Paginator(bid_list, 20)
try:
@ -24,7 +25,8 @@ def list_bids(request):
bids = paginator.page(paginator.num_pages)
context = {
'bids': bids
'bids': bids,
'sales': sales
}
return render(request, 'bids/list_bids.html', context)

@ -19,6 +19,7 @@
<th>Actions</th>
</tr>
{% for bid in bids %}
<tr>
<td>#{{ bid.id }}</td>
<td>{{ bid.bid_date | date:"d M, Y H:i:s" }}</td>
@ -27,7 +28,11 @@
<td>{{ bid.accepted }}</td>
<td>
{% if bid.accepted %}
<a href="{% url 'get_sale' bid.id %}" class="button alt">View Sale</a>
{% for sale in sales %}
{% if sale.bid.id == bid.id %}
<a href="{% url 'get_sale' sale.id %}" class="button alt">View Sale</a>
{% endif %}
{% endfor %}
{% else %}
<a href="{% url 'edit_bid' bid.id %}" class="button alt">Edit</a>
<a href="{% url 'delete_bid' bid.id %}" class="button red">Delete</a>