Skip to content

Commit

Permalink
Fixes #37015 - add validation error message for host_owner setting
Browse files Browse the repository at this point in the history
  • Loading branch information
nofaralfasi committed Jan 1, 2024
1 parent a1142ab commit 54585cb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/models/setting.rb
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,10 @@ def validate_host_owner
owner_type_and_id = value
return if owner_type_and_id.blank?
owner = OwnerClassifier.new(owner_type_and_id).user_or_usergroup
errors.add(:value, _("Host owner is invalid")) if owner.nil?
if owner.nil?
errors.add(:value, _("Host owner is invalid. " \
"Please ensure the input follows the format 'ID-Users/Usergroups'."))
end
end

def invalid_value_error(error)
Expand Down

0 comments on commit 54585cb

Please sign in to comment.