Commit 13ff46a419ad4359286f14f8c6f4b3eae5152f05

Authored by mykhaly
1 parent 87bb6221

Fix get_document_by_id

To find document in awards.complaints.documents
@@ -50,6 +50,10 @@ def get_document_by_id(data, doc_id): @@ -50,6 +50,10 @@ def get_document_by_id(data, doc_id):
50 for document in award.get('documents', []): 50 for document in award.get('documents', []):
51 if doc_id in document.get('title', ''): 51 if doc_id in document.get('title', ''):
52 return document 52 return document
  53 + for complaint in award.get('complaints', []):
  54 + for document in complaint.get('documents', []):
  55 + if doc_id in document.get('title, ''):
  56 + return document
53 raise Exception('Document with id {} not found'.format(doc_id)) 57 raise Exception('Document with id {} not found'.format(doc_id))
54 58
55 59
Please register or login to post a comment