-
Notifications
You must be signed in to change notification settings - Fork 900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle picture correctly on service template update/create #18674
Handle picture correctly on service template update/create #18674
Conversation
app/models/service_template.rb
Outdated
@@ -509,7 +513,10 @@ def resource_action_list | |||
|
|||
def update_from_options(params) | |||
options[:config_info] = params[:config_info] | |||
update_attributes!(params.except(:config_info)) | |||
if params[:picture] | |||
update_attributes!(:picture => Picture.create(:content => params[:picture][:content], :extension => 'jpg')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we only support jpg? If not, how do we know the extension?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ugh, fine, no, to the first: https://github.com/ManageIQ/manageiq/blob/master/app/models/picture.rb#L5 and ugh, fine, i guess it's we assume it's in the params too? maaaaaybe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe? I don't know how we create pictures.
Looks good, only had a question above. |
e11a5e5
to
b74de6e
Compare
Checked commit d-m-u@b74de6e with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
…th_picture Handle picture correctly on service template update/create (cherry picked from commit d26ae5a) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1702479
Hammer backport details:
|
We're not creating service templates with pictures correctly (or updating them) because the template is expecting a picture and instead gets a hash of options to create the picture.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1683723