Skip to content

Commit 9e5c282

Browse files
committed
Use public REST URL prefix in 'ontology already exists' 409 error
The 409 error returned when creating an ontology with an existing acronym interpolated ont.id directly, exposing the internal id_url_prefix (http://data.bioontology.org/) instead of the portal's public URL. Run the id through Base.replace_url_id_to_prefix so the message reports the configured rest_url_prefix, matching normal serialized output.
1 parent e2ad834 commit 9e5c282

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

controllers/ontologies_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ def create_ontology
182182
ont = instance_from_params(Ontology, params)
183183
else
184184
error_msg = <<-ERR
185-
Ontology already exists, see #{ont.id}
185+
Ontology already exists, see #{LinkedData::Models::Base.replace_url_id_to_prefix(ont.id)}
186186
To add a new submission, POST to: /ontologies/#{params['acronym']}/submission.
187187
To modify the resource, use PATCH.
188188
ERR

0 commit comments

Comments
 (0)