Skip to content

Commit

Permalink
Correct collection_id extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgrady committed May 28, 2021
1 parent f6600c0 commit 6c36d21
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions flask_app/sp_cache/process_dwca.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,8 @@ def process_dwca_directory(in_directory, out_directory):
print('Processing file: {}'.format(dwca_filename))
# File pattern is: "collection-{collection_id}-post-YYYY_MM_DD_HH_MM_SS.zip"
# Get collection id, handle scenario where -post- is present within
collection_id = '-post-'.join(
dwca_filename.split('collection-')[1].split('-post-')[:-1]
)
# Start after "collection-"
collection_id = os.path.basename(dwca_filename)[11:].split('-post-')[0]
try:
process_dwca(dwca_filename, collection_id)
shutil.move(
Expand Down

0 comments on commit 6c36d21

Please sign in to comment.