schmidtocean / sealog-server

Sealog event logging server
MIT License
0 stars 0 forks source link

BUG - EXPORTS - cruise/lowering files only pdfs exported #4

Closed KaarelRaeis-SOI closed 1 month ago

KaarelRaeis-SOI commented 3 months ago

Filepond allows uploading any filetype but with no warning only pdfs are actually transferred on lowering export

This issue goes back a while, I can see broken links on SeaCloud where docx isn't there in 2023

We're working to include geotiffs with every dive so it'd be useful to expand on that This is an admin level task so no need for babysitting what gets uploaded

Also anything that isn't a report but is a pdf is pulled into the Reports folder

        logging.info("Export Reports")
        subprocess.call(['rsync','-avi','--progress', '--delete', '--include=*.pdf', '--exclude=*', os.path.join(API_SERVER_FILE_PATH, 'lowerings', lowering['id'], ''), os.path.join(lowering_source_dir, REPORTS_DIRNAME)])

so perhaps do

        logging.info("Export Reports")
        subprocess.call(['rsync','-avi','--progress', '--delete', '--include=*_Report.pdf', '--exclude=*', os.path.join(API_SERVER_FILE_PATH, 'lowerings', lowering['id'], ''), os.path.join(lowering_source_dir, REPORTS_DIRNAME)])

        logging.info("Export User Uploaded Files")
        subprocess.call(['rsync','-avi','--progress', '--delete', '--include=*', '--exclude=*.pdf', os.path.join(API_SERVER_FILE_PATH, 'lowerings', lowering['id'], ''), os.path.join(lowering_source_dir, FILES_DIRNAME)])

Or just put extra files in the Sealog root dir This will break SeaCloud file import logic but that can be fixed

KaarelRaeis-SOI commented 2 months ago

Discussed with Corinne, @webbpinner could you fix/push this issue as it will likely affect other orgs

webbpinner commented 2 months ago

Thanks for bringing this to my attention. I just took a look at the current export script template and it appears to have already been fixed.

KaarelRaeis-SOI commented 1 month ago

Fixed by the following commits: