aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/body_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/body_controller.rb')
-rw-r--r--app/controllers/body_controller.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/app/controllers/body_controller.rb b/app/controllers/body_controller.rb
index 6d95cb8f4..e3f4cd8cb 100644
--- a/app/controllers/body_controller.rb
+++ b/app/controllers/body_controller.rb
@@ -4,7 +4,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: body_controller.rb,v 1.22 2009-03-22 09:08:39 tony Exp $
+# $Id: body_controller.rb,v 1.23 2009-03-22 10:31:20 tony Exp $
class BodyController < ApplicationController
# XXX tidy this up with better error messages, and a more standard infrastructure for the redirect to canonical URL
@@ -25,15 +25,11 @@ class BodyController < ApplicationController
# Use search query for this so can collapse and paginate easily
# XXX really should just use SQL query here rather than Xapian.
- begin
- @xapian_requests = perform_search([InfoRequestEvent], 'requested_from:' + @public_body.url_name, 'newest', 'request_collapse')
- if (@page > 1)
- @page_desc = " (page " + @page.to_s + ")"
- else
- @page_desc = ""
- end
- rescue
- @xapian_requests = nil
+ @xapian_requests = @public_body.xapian_requests
+ if (@page > 1)
+ @page_desc = " (page " + @page.to_s + ")"
+ else
+ @page_desc = ""
end
@track_thing = TrackThing.create_track_for_public_body(@public_body)