Skip to content

Commit

Permalink
Fix for "mytardis datafile upload dataset_id filename" for the
Browse files Browse the repository at this point in the history
case where filename is in the current directory, so it doesn't
have a path prefix.
  • Loading branch information
wettenhj committed Mar 11, 2016
1 parent 0c3b964 commit 8273914
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mytardisclient/models/datafile.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,9 @@ def upload(dataset_id, dataset_path, file_path):
directory, filename = os.path.split(file_path_without_dataset)
else:
file_path_components = file_path.split(os.sep)
_ = file_path_components.pop(0) # local_dataset_path
filename = file_path_components.pop(-1)
if len(file_path_components) > 0:
_ = file_path_components.pop(0) # local_dataset_path
if len(file_path_components) > 0:
directory = os.path.join(*file_path_components)
else:
Expand Down

0 comments on commit 8273914

Please sign in to comment.