Bug #18771

error when resource does not have id ActiveRecord::RecordInvalid: Validation failed: Resource can't be blank

Added by Thomas McKay about 1 year ago. Updated 11 months ago.

Assigned To:Ivan Necas
Target version:Foreman - Team Ivan Iteration 16
Difficulty: Bugzilla link:1428371
Found in release: Pull request:https://github.com/theforeman/foreman-tasks/pull/256
Story points-
Velocity based estimate-
Releaseforeman-tasks-0.9.3Release relationshipAuto


When a resource is going to be locked, the lock requires that the resource has an id (see validation in lock.rb). Without this there are errors.

To reproduce, register a content host with subscription-manager and update facts:
subscription-manager register --username admin --password changeme --org Default_Organization --env Library
subscription-manager facts --update

The CpConsumerUser does not have an id since it is a temporary user used just for the length of the call.

Associated revisions

Revision b619e6e9
Added by Ivan Necas 12 months ago

Fixes #18771 - ensure User.current.id is present when setting owner


#1 Updated by Thomas McKay about 1 year ago

  • Bugzilla link set to 1428371

#2 Updated by Adam Ruzicka about 1 year ago

  • Target version set to Team Ivan backlog

#3 Updated by The Foreman Bot 12 months ago

  • Status changed from New to Ready For Testing
  • Assigned To set to Ivan Necas
  • Pull request https://github.com/theforeman/foreman-tasks/pull/256 added

#4 Updated by Ivan Necas 12 months ago

  • Target version changed from Team Ivan backlog to Team Ivan Iteration 16

#5 Updated by Ivan Necas 12 months ago

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

#6 Updated by Ivan Necas 11 months ago

  • Release set to foreman-tasks-0.9.3

Also available in: Atom PDF