diff --git a/openregistry/lots/loki/tests/blanks/lot_blanks.py b/openregistry/lots/loki/tests/blanks/lot_blanks.py index 4d57f6b..5870548 100644 --- a/openregistry/lots/loki/tests/blanks/lot_blanks.py +++ b/openregistry/lots/loki/tests/blanks/lot_blanks.py @@ -1572,6 +1572,7 @@ def change_pending_deleted_lot(self): self.assertEqual(response.json['data']['auctions'][0]['status'], 'cancelled') self.assertEqual(response.json['data']['auctions'][1]['status'], 'cancelled') self.assertEqual(response.json['data']['auctions'][2]['status'], 'cancelled') + self.assertEqual(response.json['data']['contracts'][0]['status'], 'cancelled') # Create new lot in 'pending.deleted' status self.app.authorization = ('Basic', ('broker', '')) @@ -1602,6 +1603,7 @@ def change_pending_deleted_lot(self): self.assertEqual(response.json['data']['auctions'][0]['status'], 'cancelled') self.assertEqual(response.json['data']['auctions'][1]['status'], 'cancelled') self.assertEqual(response.json['data']['auctions'][2]['status'], 'cancelled') + self.assertEqual(response.json['data']['contracts'][0]['status'], 'cancelled') # Create new lot in 'pending.deleted' status self.app.authorization = ('Basic', ('broker', '')) diff --git a/openregistry/lots/loki/utils.py b/openregistry/lots/loki/utils.py index 317c00e..456d060 100644 --- a/openregistry/lots/loki/utils.py +++ b/openregistry/lots/loki/utils.py @@ -63,6 +63,7 @@ def process_lot_status_change(request): if lot.status == 'pending.deleted' and request.validated['data'].get('status') == 'deleted': for auction in lot.auctions: auction.status = 'cancelled' + lot.contracts[0].status = 'cancelled' def process_caravan_contract_report_result(request):