Skip to content

Commit

Permalink
Fixed: broken projects/index page because @datacenter was not set in …
Browse files Browse the repository at this point in the history
…some cases
  • Loading branch information
jbbarth committed Feb 20, 2010
1 parent 528cee9 commit 14cd79f
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions lib/query_patch.rb
Expand Up @@ -3,13 +3,16 @@
class Query
def available_filters_with_datacenter_custom_filters
available_filters_without_datacenter_custom_filters
if project && project.module_enabled?(:datacenter)
@available_filters["server_id"] = { :type => :list,
:order => 25,
:values => Server.for_datacenter(@datacenter.id).collect{|s| [s.name, s.id.to_s] } }
@available_filters["appli_id"] = { :type => :list,
:order => 30,
:values => Appli.for_datacenter(@datacenter.id).collect{|s| [s.name, s.id.to_s] } }
if project && project.module_enabled?(:datacenter) && project.datacenter
datacenter = project.datacenter
if datacenter
@available_filters["server_id"] = { :type => :list,
:order => 25,
:values => Server.for_datacenter(datacenter.id).collect{|s| [s.name, s.id.to_s] } }
@available_filters["appli_id"] = { :type => :list,
:order => 30,
:values => Appli.for_datacenter(datacenter.id).collect{|s| [s.name, s.id.to_s] } }
end
end
@available_filters
end
Expand Down

0 comments on commit 14cd79f

Please sign in to comment.