Skip to content

Commit

Permalink
Merge branch 'a157395766181019_fix_deliveryDate_startDate'
Browse files Browse the repository at this point in the history
  • Loading branch information
vmaksymiv committed Jul 26, 2016
2 parents 165522f + 27562b4 commit 71c708f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions openprocurement/contracting/api/databridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,15 @@ def get_tender_contracts(self):
extra=journal_context({"MESSAGE_ID": DATABRIDGE_MISSING_CONTRACT_ITEMS},
{"CONTRACT_ID": contract['id'], "TENDER_ID": tender['id']}))

for item in contract.get('items', []):
if 'deliveryDate' in item and 'startDate' in item['deliveryDate']:
if item['deliveryDate']['startDate'] > item['deliveryDate']['endDate']:
logger.info("Found dates missmatch {} and {}".format(item['deliveryDate']['startDate'], item['deliveryDate']['endDate']),
extra=journal_context(params={"CONTRACT_ID": contract['id'], "TENDER_ID": tender['id']}))
del item['deliveryDate']['startDate']
logger.info("startDate value cleaned.",
extra=journal_context(params={"CONTRACT_ID": contract['id'], "TENDER_ID": tender['id']}))

self.handicap_contracts_queue.put(contract)

def prepare_contract_data(self):
Expand Down

0 comments on commit 71c708f

Please sign in to comment.