Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions hellosign_sdk/hsclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ def get_template_files(self, template_id, path_or_file=None, file_type=None,
url += '?get_data_uri=1'
return request.get(url)

def update_template_files(self, template_id, files=None, file_urls=None,
def update_template_files(self, template_id, file=None, file_url=None,
subject=None, message=None, client_id=None, test_mode=False):
''' Overlays a new file with the overlay of an existing template.

Expand All @@ -984,15 +984,16 @@ def update_template_files(self, template_id, files=None, file_urls=None,
A Template object

'''
files_payload = HSFormat.format_file_params(file)
request = self._get_request()
return request.post(self.TEMPLATE_UPDATE_FILES_URL + template_id, data={
"files": files,
"file_urls": file_urls,
"file": file,
"file_url": file_url,
"subject": subject,
"message": message,
"test_mode": self._boolean(test_mode),
"client_id": client_id
})
}, files=files_payload)

def create_embedded_template_draft(self, client_id, signer_roles, test_mode=False,
files=None, file_urls=None, title=None, subject=None, message=None,
Expand Down
5 changes: 4 additions & 1 deletion hellosign_sdk/utils/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ def _check_error(self, response, json_response=None):
raise err_cls("%s error: %s" % (response.status_code, json_response["error"]["error_msg"]), response.status_code)
# This is to catch error when we post get oauth data
except TypeError:
raise err_cls("%s error: %s" % (response.status_code, json_response["error_description"]), response.status_code)
try:
raise err_cls("%s error: %s" % (response.status_code, json_response["error_description"]), response.status_code)
except TypeError:
raise err_cls("%s error" % response.status_code)

# Return True if everything is OK
return True
Expand Down