Add condition for user not found in trace controller.

Closes #1710
This commit is contained in:
Thomas Wood 2009-04-19 21:22:34 +00:00
parent c29c7cd56c
commit e8c7543bdd
2 changed files with 7 additions and 0 deletions

View file

@ -16,6 +16,11 @@ class TraceController < ApplicationController
display_name = params[:display_name] display_name = params[:display_name]
if target_user.nil? and !display_name.blank? if target_user.nil? and !display_name.blank?
target_user = User.find(:first, :conditions => [ "visible = ? and display_name = ?", true, display_name]) target_user = User.find(:first, :conditions => [ "visible = ? and display_name = ?", true, display_name])
if target_user.nil?
@not_found_user = display_name
render :action => 'no_such_user', :status => :not_found
return
end
end end
# set title # set title

View file

@ -0,0 +1,2 @@
<h2><%= h(@not_found_user) %></h2>
<p>Sorry, there is no user with the name <%= @not_found_user -%>. Please check your spelling, or maybe the link you clicked is wrong.</p>