Skip to content

Commit d7b0d83

Browse files
committed
[LIB-852] allow to create file when updating non exsiting;
1 parent 962253e commit d7b0d83

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

syncano/models/hosting.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,16 @@ def update_file(self, path, file):
6060
"""
6161
hosting_files = self._get_files()
6262
is_found = False
63+
6364
for hosting_file in hosting_files:
6465
if hosting_file.path == path:
6566
is_found = True
6667
break
6768

6869
if not is_found:
69-
raise SyncanoRequestError('File with path {} not found.'.format(path))
70+
# create if not found;
71+
hosting_file = self.upload_file(path, file)
72+
return hosting_file
7073

7174
connection = self._get_connection()
7275
headers = self._prepare_header(connection)

0 commit comments

Comments
 (0)