Permalink
Browse files

Merge pull request #520 from CristinaRO/Issue_2946_profile_no_user

Issue 2946: loading profile of a non-existent user
  • Loading branch information...
2 parents 0391019 + e3e3cbe commit fb4af7e26e9200f6fd05845dd262517bd76d004c @elzj elzj committed Mar 12, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/controllers/profile_controller.rb
@@ -3,8 +3,8 @@ class ProfileController < ApplicationController
def show
@user = User.find_by_login(params[:user_id])
if @user.nil?
- flash[:error] = t('invalid_user', :default => "Sorry, there's no user by that name.")
- redirect_to '/'
+ flash[:error] = ts("Sorry, there's no user by that name.")
+ redirect_to '/' and return
elsif @user.profile.nil?
Profile.create(:user_id => @user.id)
@user.reload

0 comments on commit fb4af7e

Please sign in to comment.