Skip to content
This repository
Browse code

Merge pull request #520 from CristinaRO/Issue_2946_profile_no_user

Issue 2946: loading profile of a non-existent user
  • Loading branch information...
commit fb4af7e26e9200f6fd05845dd262517bd76d004c 2 parents 0391019 + e3e3cbe
Elz elzj authored

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. +2 2 app/controllers/profile_controller.rb
4 app/controllers/profile_controller.rb
@@ -3,8 +3,8 @@ class ProfileController < ApplicationController
3 3 def show
4 4 @user = User.find_by_login(params[:user_id])
5 5 if @user.nil?
6   - flash[:error] = t('invalid_user', :default => "Sorry, there's no user by that name.")
7   - redirect_to '/'
  6 + flash[:error] = ts("Sorry, there's no user by that name.")
  7 + redirect_to '/' and return
8 8 elsif @user.profile.nil?
9 9 Profile.create(:user_id => @user.id)
10 10 @user.reload

0 comments on commit fb4af7e

Please sign in to comment.
Something went wrong with that request. Please try again.