save uploads under their key, not their title #18
1 changed files with 4 additions and 4 deletions
|
|
@ -60,8 +60,8 @@ class AnnexRegistrator(object):
|
|||
Compute the target path for a file in the repository.
|
||||
# attachments/
|
||||
# schema-type/
|
||||
# pid/
|
||||
# title.ext
|
||||
# pid-distribution-of/
|
||||
# key
|
||||
:param info: A dictionary with information about the file
|
||||
:param pid_transformation: A function to perform string substitution
|
||||
to sanitize paths
|
||||
|
|
@ -69,7 +69,7 @@ class AnnexRegistrator(object):
|
|||
file_path =\
|
||||
f'attachments/{pid_transformation(info["schema"])}/' \
|
||||
f'{pid_transformation(info["pid"])}/' \
|
||||
f'{pid_transformation(info["title"])}'
|
||||
f'{pid_transformation(info["key"])}'
|
||||
return file_path
|
||||
|
||||
def register(self) -> None:
|
||||
|
|
@ -125,7 +125,7 @@ class AnnexRegistrator(object):
|
|||
# TODO: change keys/placeholder later once structure of records is
|
||||
# known
|
||||
self.mapping[key] =\
|
||||
{'title': dist_record.get('display_label', 'placeholder'),
|
||||
{'key': key,
|
||||
'schema': dist_record.get('schema_type', 'placeholder'),
|
||||
'pid': dist_record.get('pid', 'placeholder'),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue