check_override_selected checks changes not performed by user
|Assigned To:||Ori Rabin|
|Target version:||Team Ivan Iteration 3|
|Found in release:||Pull request:||https://github.com/theforeman/foreman/pull/3804|
|Velocity based estimate||-|
check_override_selected is run before validations when saving a smart class parameters.
Actions that are called before validation like cast_default_value can add changed attributes that are later checked and can cause a validation message.
1) Import puppetclass with a boolean smart class parameter with the value 't' or 'f'
2) Edit the puppetclass and click save (without any changes)
The result should be that it saves since no changes were made.
Actual result: "override must be true to edit the parameter"
This is because when saving the default value is casted and changed to 'true'.
check_override_selected catches that change as something that is not allowed unless override is true.