Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/a183841703369017_items_are_not_r…
Browse files Browse the repository at this point in the history
…equired'
  • Loading branch information
vmaksymiv committed Jan 17, 2017
2 parents f25c1a1 + 7a64c18 commit 18d6aeb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions openprocurement/contracting/api/databridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ def _get_tender_contracts(self):
extra=journal_context({"MESSAGE_ID": DATABRIDGE_COPY_CONTRACT_ITEMS}, params={"CONTRACT_ID": contract['id'], "TENDER_ID": tender['id']}))
contract['items'] = tender['items']

if isinstance(contract.get('items', None), list) and len(contract.get('items')) == 0:
logger.info("Clearing 'items' key for contract with empty 'items' list", extra=journal_context({"MESSAGE_ID": DATABRIDGE_COPY_CONTRACT_ITEMS},
{"CONTRACT_ID": contract['id'], "TENDER_ID": tender_to_sync['id']}))
del contract['items']

if not contract.get('items'):
logger.warn('Contact {} of tender {} does not contain items info'.format(contract['id'], tender['id']),
extra=journal_context({"MESSAGE_ID": DATABRIDGE_MISSING_CONTRACT_ITEMS},
Expand Down

0 comments on commit 18d6aeb

Please sign in to comment.