diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 93ff34e87..64a00becd 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -36,8 +36,6 @@ class PeopleController < ApplicationController if @contact @aspects_with_person = @contact.aspects - else - @pending_request = current_user.request_for(@person) end @posts = current_user.visible_posts(:person_id => @person.id, :_type => "StatusMessage").paginate :page => params[:page], :order => 'created_at DESC' diff --git a/app/controllers/photos_controller.rb b/app/controllers/photos_controller.rb index 39c3c8c83..9a090992d 100644 --- a/app/controllers/photos_controller.rb +++ b/app/controllers/photos_controller.rb @@ -20,8 +20,6 @@ class PhotosController < ApplicationController if @contact @aspects_with_person = @contact.aspects - else - @pending_request = current_user.pending_requests.find_by_person_id(@person.id) end @posts = current_user.raw_visible_posts.all(:_type => 'Photo', :person_id => @person.id, :order => 'created_at DESC').paginate :page => params[:page], :order => 'created_at DESC' diff --git a/app/helpers/people_helper.rb b/app/helpers/people_helper.rb index 1a382a499..c3fbf7b1f 100644 --- a/app/helpers/people_helper.rb +++ b/app/helpers/people_helper.rb @@ -28,4 +28,8 @@ module PeopleHelper end end + def pending_request_for(person) + current_user.request_for(person) + end + end diff --git a/app/views/people/show.html.haml b/app/views/people/show.html.haml index 53cfe10ab..bc53f5e36 100644 --- a/app/views/people/show.html.haml +++ b/app/views/people/show.html.haml @@ -29,7 +29,7 @@ %h3 = t('.not_connected', :name => @person.real_name) - - unless @pending_request + - unless pending_request_for(@person) %h3 .description = t('.request_people')