changeset 94:fb3d7118d65f cannam

Merge from branch "luisf"
author Chris Cannam
date Thu, 16 Dec 2010 13:04:16 +0000
parents d357e6b0b8e3 (current diff) 7366fb57fce9 (diff)
children 74cb18079dd6
files
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/app/controllers/users_controller.rb	Thu Dec 16 11:41:32 2010 +0000
+++ b/app/controllers/users_controller.rb	Thu Dec 16 13:04:16 2010 +0000
@@ -51,9 +51,11 @@
   
   def show
     @user = User.find(params[:id])
+
+    if @user.ssamr_user_detail != nil
+      @description = @user.ssamr_user_detail.description
+    end
     
-    @description = @user.ssamr_user_detail.description
-            
     # show projects based on current user visibility
     @memberships = @user.memberships.all(:conditions => Project.visible_by(User.current))
     
@@ -155,7 +157,14 @@
     @user.pref.attributes = params[:pref]
     @user.pref[:no_self_notified] = (params[:no_self_notified] == '1')
 
-    @ssamr_user_details = @user.ssamr_user_detail
+    if @user.ssamr_user_detail == nil
+      @ssamr_user_details = SsamrUserDetail.new()
+      @user.ssamr_user_detail = @ssamr_user_details
+    else
+      @ssamr_user_details = @user.ssamr_user_detail
+    end
+
+
     if params[:ssamr_user_details].nil? or params[:ssamr_user_details].empty?
       @ssamr_user_details.description = @user.ssamr_user_detail.description
     else