From af55b1714bf4c5edd4b4e5027190147b9b69c130 Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Mon, 27 Aug 2012 15:48:42 +0200 Subject: [PATCH] fix the profile page when the url contains an owner that is not available for this user --- app/controllers/profiles_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index ecebbeb593..27504a1178 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -8,6 +8,7 @@ class ProfilesController < ApplicationController before_filter :authenticate_user! before_filter :first_sync, :only => :show before_filter :verify_tab + before_filter :verify_owner responders :json respond_to :json @@ -55,6 +56,10 @@ def verify_tab params[:tab] ||= tabs.first end + def verify_owner + not_found unless owner + end + def tabs @tabs ||= %w(repos profile).select { |tab| display_tab?(tab) } end