Skip to content

Commit

Permalink
Fix: Render 404 for non-existing ontologies and projects
Browse files Browse the repository at this point in the history
  • Loading branch information
alexskr committed Dec 2, 2024
1 parent f0d0680 commit 0353288
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/ontologies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def show

# Note: find_by_acronym includes ontology views
@ontology = LinkedData::Client::Models::Ontology.find_by_acronym(params[:ontology], include: 'all').first
not_found if @ontology.nil?
not_found if @ontology&.errors && [401, 403, 404].include?(@ontology&.status)

# Handle the case where an ontology is converted to summary only.
# See: https://github.com/ncbo/bioportal_web_ui/issues/133.
Expand Down
1 change: 1 addition & 0 deletions app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ def index

def show
@project = LinkedData::Client::Models::Project.get(params[:id])
not_found if @project&.errors && @project.status == 404
@ontologies_used = []
onts_used = @project.ontologyUsed
onts_used.each do |ont_used|
Expand Down

0 comments on commit 0353288

Please sign in to comment.