mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-16 16:16:43 +10:00
Merge branch 'fix_avatar_url' into 'master'
Remove unnecessary / from avatar url ## What does this MR do? This MR removes the unecessary / from the avatar url. ## What Use Case does this MR solve? The // in the url cold lead to avatars not being displayed (reported on IRC) With this MR the avatar url changes from http://localhost:3000//uploads/user/avatar/1/gitlab_logo.png to http://localhost:3000/uploads/user/avatar/1/gitlab_logo.png @dblessing Can you take a look? See merge request !303
This commit is contained in:
+1
-1
@@ -497,7 +497,7 @@ class User < ActiveRecord::Base
|
||||
|
||||
def avatar_url(size = nil)
|
||||
if avatar.present?
|
||||
[gitlab_config.url, avatar.url].join("/")
|
||||
[gitlab_config.url, avatar.url].join
|
||||
else
|
||||
GravatarService.new.execute(email, size)
|
||||
end
|
||||
|
||||
@@ -73,7 +73,7 @@ describe ApplicationHelper do
|
||||
user = create(:user)
|
||||
user.avatar = File.open(avatar_file_path)
|
||||
user.save!
|
||||
avatar_icon(user.email).to_s.should match("/gitlab//uploads/user/avatar/#{ user.id }/gitlab_logo.png")
|
||||
avatar_icon(user.email).to_s.should match("/gitlab/uploads/user/avatar/#{ user.id }/gitlab_logo.png")
|
||||
end
|
||||
|
||||
it "should call gravatar_icon when no avatar is present" do
|
||||
|
||||
Reference in New Issue
Block a user