Bug #16378

check_override_selected checks changes not performed by user

Added by Ori Rabin 12 months ago. Updated 11 months ago.

Assigned To:Ori Rabin
Category:Smart Variables
Target version:Team Ivan Iteration 3
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/3804
Story points-
Velocity based estimate-
Release1.13.1Release relationshipAuto


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.

Associated revisions

Revision 1ebc15ea
Added by Ori Rabin 11 months ago

Fixes #16378 - Move default_value casting to lookup_key children


#1 Updated by The Foreman Bot 12 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3804 added

#2 Updated by Ivan Necas 11 months ago

  • Target version set to Team Ivan Iteration 3

#3 Updated by Ori Rabin 11 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#4 Updated by Dominic Cleal 11 months ago

  • Category set to Smart Variables
  • Release set to 1.13.1

Also available in: Atom PDF