Project

General

Profile

Actions

Bug #14369

closed

When creating new organization, host selection step won't show, if the user is n context of different organization.

Added by Shimon Shtein about 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Organizations and Locations
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Steps to reproduce:

1. Make sure you have a host without organization.
2. Pick an organization for your context (Make sure you have organization name instead of "Any context")
3. Create a new organization

Expected: Redirection to "Step 2" - hosts selector

Actual: Redirection to Edit organization screen.

The problem is in #count_nil_hosts, it uses Host.where(taxonomy_id => nil).count to check for unassigned hosts.
By default this is scoped:

Host.where(taxonomy_id => nil).to_sql
#=> "SELECT \"hosts\".* FROM \"hosts\"  WHERE \"hosts\".\"type\" IN ('Host::Managed') AND \"hosts\".\"location_id\" IN (12) AND \"hosts\".\"location_id\" IS NULL" 

This query will always return 0.


Related issues 1 (0 open1 closed)

Related to Foreman - Bug #14252: Creating a new organization redirects to list rather than host assignment and edit propertiesClosedShimon Shtein03/17/2016Actions
Actions #2

Updated by Shimon Shtein about 8 years ago

  • Related to Bug #14252: Creating a new organization redirects to list rather than host assignment and edit properties added
Actions #3

Updated by The Foreman Bot about 8 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3371 added
Actions #4

Updated by Shimon Shtein about 8 years ago

  • Bugzilla link set to 1321826
Actions #5

Updated by Ivan Necas almost 8 years ago

  • translation missing: en.field_release set to 136
Actions #6

Updated by Shimon Shtein almost 8 years ago

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

Also available in: Atom PDF