Skip to content

Commit

Permalink
Fix: remove file parameters when no file is uploaded (#99)
Browse files Browse the repository at this point in the history
Co-authored-by: Syphax <[email protected]>
  • Loading branch information
muhammedBkf and syphax-bouazzouni authored Oct 22, 2024
1 parent 4b62667 commit 3fb29ce
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions helpers/ontology_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ def create_submission(ont)
ont_submission.submissionId = submission_id

# Get file info
add_file_to_submission(ont, ont_submission)

filename, tmpfile = add_file_to_submission(ont, ont_submission)
# if no actual file was uploaded, we remove the file parameters
if filename.nil? && tmpfile.nil?
params.delete("uploadFilePath")
params.delete("diffFilePath")
end

# Add new format if it doesn't exist
if ont_submission.hasOntologyLanguage.nil?
error 422, "You must specify the ontology format using the `hasOntologyLanguage` parameter" if params["hasOntologyLanguage"].nil? || params["hasOntologyLanguage"].empty?
Expand Down

0 comments on commit 3fb29ce

Please sign in to comment.