Skip to content

Commit

Permalink
fix: Fix crash when create_file called without options (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
renyuneyun authored Nov 2, 2023
1 parent 5c68a98 commit 3d6103b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/solid/solid_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,12 +158,12 @@ def create_folder(self, url, options: WriteOptions = WriteOptions(merge=MERGE.KE

return self.post_item(url, '', 'text/turtle', LINK.CONTAINER, options)

def post_file(self, url, content: RequestContent, content_type, options: WriteOptions = None) -> Response:
def post_file(self, url, content: RequestContent, content_type, options: WriteOptions = WriteOptions(create_path=False, with_acl=False)) -> Response:
if url[-1] == '/':
raise Exception(f'Cannot use postFile to create a folder : ${url}')
return self.post_item(url, content, content_type, LINK.RESOURCE, options)

def create_file(self, url, content: RequestContent, content_type, options: WriteOptions = None) -> Response:
def create_file(self, url, content: RequestContent, content_type, options: WriteOptions = WriteOptions(with_acl=False)) -> Response:
return self.post_file(url, content, content_type, options)

"""
Expand Down

0 comments on commit 3d6103b

Please sign in to comment.