Skip to content

Commit

Permalink
[webui] fix old compat icon route again
Browse files Browse the repository at this point in the history
we should not use it anymore and add icons to test suite to be able to test this at all
  • Loading branch information
adrianschroeter committed Feb 11, 2015
1 parent b48304b commit 90abe63
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/api/app/controllers/webui/user_controller.rb
Expand Up @@ -176,9 +176,15 @@ def overwrite_user

private :overwrite_user

def icon
def user_icon
required_parameters :icon
user = User.find_by_login! params[:icon].gsub(/.png$/,'')
params[:user] = params[:icon].gsub(/.png$/,'')
icon
end

def icon
required_parameters :user
user = User.find_by_login! params[:user]
size = params[:size].to_i || '20'
content = user.gravatar_image(size)

Expand Down
2 changes: 1 addition & 1 deletion src/api/config/routes.rb
Expand Up @@ -288,7 +288,7 @@ def self.matches?(request)
get 'user/notifications' => :notifications

get 'user/show/:user' => :show, constraints: cons, as: 'user_show'
get 'user/icon/:icon' => :icon, constraints: cons, as: 'user_icon'
get 'user/icon/:icon' => :user_icon, constraints: cons, as: 'user_icon'
get 'user/requests/:user' => :requests, constraints: cons, as: 'user_requests'
# Only here to make old /home url's work
get 'home/' => :home, as: 'home'
Expand Down

0 comments on commit 90abe63

Please sign in to comment.