def post(self): """Report auction results for lot. """ apply_patch(self.request, save=False, src=self.request.validated['auction_src']) auction = self.request.validated['auction'] if all([ i.auctionPeriod and i.auctionPeriod.endDate for i in auction.lots if i.numberOfBids > 1 and i.status == 'active' ]): cleanup_bids_for_cancelled_lots(auction) invalidate_bids_under_threshold(auction) if any([i.status == 'active' for i in auction.bids]): create_awards(self.request) else: auction.status = 'unsuccessful' if save_auction(self.request): self.LOGGER.info('Report auction results', extra=context_unpack( self.request, {'MESSAGE_ID': 'auction_lot_auction_post'})) return { 'data': self.request.validated['auction'].serialize( self.request.validated['auction'].status) }
def post(self): """Report auction results for lot. """ apply_patch(self.request, save=False, src=self.request.validated['auction_src']) if all([i.auctionPeriod and i.auctionPeriod.endDate for i in self.request.validated['auction'].lots if i.numberOfBids > 1 and i.status == 'active']): cleanup_bids_for_cancelled_lots(self.request.validated['auction']) add_next_award(self.request) if save_auction(self.request): self.LOGGER.info('Report auction results', extra=context_unpack(self.request, {'MESSAGE_ID': 'auction_lot_auction_post'})) return {'data': self.request.validated['auction'].serialize(self.request.validated['auction'].status)}
def post(self): """Report auction results for lot. """ apply_patch(self.request, save=False, src=self.request.validated['auction_src']) if all([ i.auctionPeriod and i.auctionPeriod.endDate for i in self.request.validated['auction'].lots if i.numberOfBids > 1 and i.status == 'active' ]): cleanup_bids_for_cancelled_lots(self.request.validated['auction']) add_next_award(self.request) if save_auction(self.request): self.LOGGER.info('Report auction results', extra=context_unpack( self.request, {'MESSAGE_ID': 'auction_lot_auction_post'})) return { 'data': self.request.validated['auction'].serialize( self.request.validated['auction'].status) }