Commit 13ff46a419ad4359286f14f8c6f4b3eae5152f05
1 parent
87bb6221
Fix get_document_by_id
To find document in awards.complaints.documents
Showing
1 changed file
with
4 additions
and
0 deletions
... | ... | @@ -50,6 +50,10 @@ def get_document_by_id(data, doc_id): |
50 | 50 | for document in award.get('documents', []): |
51 | 51 | if doc_id in document.get('title', ''): |
52 | 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 | 57 | raise Exception('Document with id {} not found'.format(doc_id)) |
54 | 58 | |
55 | 59 | ... | ... |
Please
register
or
login
to post a comment