Bug #18771

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

Added by Thomas McKay 4 months ago. Updated 4 days ago.

Status:Closed
Priority:Normal
Assigned To:Ivan Necas
Category:-
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

Description

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 16 days ago

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

History

#1 Updated by Thomas McKay 4 months ago

  • Bugzilla link set to 1428371

#2 Updated by Adam Ruzicka 3 months ago

  • Target version set to Team Ivan backlog

#3 Updated by The Foreman Bot 18 days 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 18 days ago

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

#5 Updated by Ivan Necas 16 days ago

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

#6 Updated by Ivan Necas 4 days ago

  • Release set to foreman-tasks-0.9.3

Also available in: Atom PDF