Commit 760ef5340dce4ade1c6082df769a65687f850beb

Authored by mykhaly
1 parent 374511dc

Add section for search in cancellations

Into `get_document_by_id` in order to find documents in cancelation.robot
@@ -54,6 +54,10 @@ def get_document_by_id(data, doc_id): @@ -54,6 +54,10 @@ def get_document_by_id(data, doc_id):
54 for document in complaint.get('documents', []): 54 for document in complaint.get('documents', []):
55 if doc_id in document.get('title', ''): 55 if doc_id in document.get('title', ''):
56 return document 56 return document
  57 + for cancellation in data.get('cancellations', []):
  58 + for document in cancellation.get('documents', []):
  59 + if doc_id in document.get('title', ''):
  60 + return document
57 raise Exception('Document with id {} not found'.format(doc_id)) 61 raise Exception('Document with id {} not found'.format(doc_id))
58 62
59 63
Please register or login to post a comment