Skip to content

Commit

Permalink
Disable fix_url if url missing and documentType contractProforma
Browse files Browse the repository at this point in the history
  • Loading branch information
VDigitall committed Jul 10, 2020
1 parent 79c8127 commit 5ffb0db
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/openprocurement/api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ def fix_url(item, app_url):
if isinstance(item, list):
[fix_url(i, app_url) for i in item if isinstance(i, dict) or isinstance(i, list)]
elif isinstance(item, dict):
if "documentType" in item and item["documentType"] == "contractProforma" and "url" not in "item":
return
if "format" in item and "url" in item and "?download=" in item["url"]:
path = item["url"] if item["url"].startswith("/") else "/" + "/".join(item["url"].split("/")[5:])
item["url"] = app_url + ROUTE_PREFIX + path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1013,6 +1013,7 @@ def _create_contract_proforma_document_invalid(self, lots=False):
"""
data = {
"title": u"paper0000001.docx",
"format": "application/pkcs7-signature",
"hash": "md5:" + "0" * 32,
"documentType": "contractProforma"
}
Expand Down

0 comments on commit 5ffb0db

Please sign in to comment.