diff options
author | francis <francis> | 2008-04-04 01:59:40 +0000 |
---|---|---|
committer | francis <francis> | 2008-04-04 01:59:40 +0000 |
commit | db9d1dc93e19b8555706bb549da8b611d77d3a72 (patch) | |
tree | deb673f3a306b1ad202b4682f582a1a3b6c27baa /app/controllers/request_controller.rb | |
parent | 1f41d08568c692c50d7ab536402d02cec8a00c75 (diff) |
Prevent tracking same request twice.
Diffstat (limited to 'app/controllers/request_controller.rb')
-rw-r--r-- | app/controllers/request_controller.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/app/controllers/request_controller.rb b/app/controllers/request_controller.rb index 334edbbff..693352c91 100644 --- a/app/controllers/request_controller.rb +++ b/app/controllers/request_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: request_controller.rb,v 1.70 2008-04-03 16:09:25 francis Exp $ +# $Id: request_controller.rb,v 1.71 2008-04-04 01:59:40 francis Exp $ class RequestController < ApplicationController @@ -30,6 +30,14 @@ class RequestController < ApplicationController @last_info_request_event_id = last_event.nil? ? nil : last_event.id @new_responses_count = @events_needing_description.select {|i| i.event_type == 'response'}.size + # Already tracking? + @track_thing = TrackThing.create_track_for_request(@info_request) + if @user + @existing_track = TrackThing.find_by_existing_track(@user.id, @track_thing.track_query) + else + @existing_track = nil + end + # Sidebar stuff @info_requests_same_user_same_body = InfoRequest.find(:all, :order => "created_at desc", :conditions => ["prominence = 'normal' and user_id = ? and public_body_id = ? and id <> ?", @info_request.user_id, @info_request.public_body_id, @info_request.id], |