Skip to content

Commit

Permalink
more uniform handling of calling get_irods_path()
Browse files Browse the repository at this point in the history
  • Loading branch information
hyi committed Oct 11, 2019
1 parent f5a3610 commit 309dd2b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions django_irods/views.py
Expand Up @@ -99,7 +99,8 @@ def download(request, path, rest_call=False, use_async=True, use_reverse_proxy=T
return response

istorage = res.get_irods_storage()
irods_path = res.get_irods_path(path)

irods_path = res.get_irods_path(path, prepend_short_id=False)

# in many cases, path and output_path are the same.
output_path = path
Expand All @@ -125,15 +126,15 @@ def download(request, path, rest_call=False, use_async=True, use_reverse_proxy=T
daily_date = datetime.datetime.today().strftime('%Y-%m-%d')
output_path = "zips/{}/{}/{}.zip".format(daily_date, uuid4().hex, path)

irods_path = res.get_irods_path(path)
irods_path = res.get_irods_path(path, prepend_short_id=False)
irods_output_path = res.get_irods_path(output_path, prepend_short_id=False)

store_path = u'/'.join(split_path_strs[1:]) # data/contents/{path-to-something}
if res.is_folder(store_path): # automatically zip folders
is_zip_request = True
daily_date = datetime.datetime.today().strftime('%Y-%m-%d')
output_path = "zips/{}/{}/{}.zip".format(daily_date, uuid4().hex, path)
irods_output_path = res.get_irods_path(output_path)
irods_output_path = res.get_irods_path(output_path, prepend_short_id=False)

if __debug__:
logger.debug("automatically zipping folder {} to {}".format(path, output_path))
Expand Down

0 comments on commit 309dd2b

Please sign in to comment.