Skip to content

Commit

Permalink
Merge pull request otwcode#520 from CristinaRO/Issue_2946_profile_no_…
Browse files Browse the repository at this point in the history
…user

Issue 2946: loading profile of a non-existent user
  • Loading branch information
elzj committed Mar 12, 2012
2 parents 0391019 + e3e3cbe commit fb4af7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/controllers/profile_controller.rb
Expand Up @@ -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
Expand Down

0 comments on commit fb4af7e

Please sign in to comment.