From 74b9a62cf97bcaeac52d107b3064d6b62d7b3a18 Mon Sep 17 00:00:00 2001 From: Yannick Francois Date: Mon, 14 Oct 2013 16:14:44 +0200 Subject: [PATCH] Fix user profile avatar on his page --- app/helpers/application_helper.rb | 1 + spec/controllers/admin/profiles_controller_spec.rb | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5061bb21ca..c139ac4914 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -92,6 +92,7 @@ def display_user_avatar(user, size='avatar', klass='alignleft') else user.resource.upload.avatar.url end + return if avatar_path.nil? avatar_url = File.join(this_blog.base_url, avatar_path) elsif user.twitter_profile_image.present? avatar_url = user.twitter_profile_image diff --git a/spec/controllers/admin/profiles_controller_spec.rb b/spec/controllers/admin/profiles_controller_spec.rb index 50d1f9b1d5..8f29980a3d 100644 --- a/spec/controllers/admin/profiles_controller_spec.rb +++ b/spec/controllers/admin/profiles_controller_spec.rb @@ -3,7 +3,6 @@ describe Admin::ProfilesController do render_views let!(:blog) { create(:blog) } - let(:alice) { create(:user, login: 'alice', profile: create(:profile_admin, label: Profile::ADMIN)) } describe "#index" do