4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'app/lib/katello/validators/gpg_key_content_type_validator.rb', line 4
def validate(record)
if !record.gpg_key.blank? && record.gpg_key.content_type != "gpg_key"
record.errors[:gpg_key] << _("Wrong content type submitted.")
end
if record.instance_of?(Katello::Product)
[:ssl_ca_cert, :ssl_client_cert, :ssl_client_key].each do |cert|
if !record.send(cert).blank? && record.send(cert).content_type != "cert"
record.errors[cert] << _("Wrong content type submitted.")
end
end
end
end
|