Skip to content

Commit

Permalink
fix label printing
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Aug 5, 2024
1 parent f9cfdec commit bd175f9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion auctions/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,8 @@ def median_lot_price(self):
@property
def lots_qs(self):
"""All lots in this auction"""
return Lot.objects.exclude(is_deleted=True).filter(auction=self.pk)
#return Lot.objects.exclude(is_deleted=True).filter(auction=self.pk)
return Lot.objects.exclude(is_deleted=True).filter(auctiontos_seller__auction__pk=self.pk)

@property
def total_sold_lots(self):
Expand Down
12 changes: 8 additions & 4 deletions auctions/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4864,17 +4864,21 @@ def dispatch(self, request, *args, **kwargs):
if self.print_only_unprinted:
self.queryset = self.auction.unprinted_labels_qs
else:
self.queryset = self.auction.labels_qs
for lot in self.queryset:
print(lot)
self.queryset = self.auction.lots_qs
self.queryset = self.queryset.filter(auctiontos_seller__pk__in=self.selected_tos)
if not self.get_queryset():
if not self.selected_tos:
messages.error(request, "No users selected")
else:
messages.error(request, "Couldn't find any labels to print")
return redirect(reverse('auction_printing', kwargs={'slug':self.auction.slug}))
return super().dispatch(request, *args, **kwargs)
if request.method.lower() in self.http_method_names:
handler = getattr(
self, request.method.lower(), self.http_method_not_allowed
)
else:
handler = self.http_method_not_allowed
return handler(request, *args, **kwargs)

class PickupLocationsIncoming(View, AuctionPermissionsMixin):
"""All lots destined for this location"""
Expand Down

0 comments on commit bd175f9

Please sign in to comment.