Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generate upload token to support create additional revision #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
8 changes: 5 additions & 3 deletions pydas/drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -922,7 +922,7 @@ def create_link(self, token, folder_id, url, **kwargs):
response = self.request('midas.link.create', parameters)
return response

def generate_upload_token(self, token, item_id, filename, checksum=None):
def generate_upload_token(self, token, item_id, filename, **kwargs):
"""
Generate a token to use for upload.

Expand Down Expand Up @@ -953,8 +953,10 @@ def generate_upload_token(self, token, item_id, filename, checksum=None):
parameters['token'] = token
parameters['itemid'] = item_id
parameters['filename'] = filename
if checksum is not None:
parameters['checksum'] = checksum
optional_keys = ['checksum', 'create_additional_revision']
for key in optional_keys:
if key in kwargs:
parameters[key] = kwargs[key]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I am mistaken, if checksum=None or create_additional_revision=None, the parameter should not be passed to the request.

response = self.request('midas.upload.generatetoken', parameters)
return response['token']

Expand Down