diff app/controllers/users_controller.rb @ 185:594ed6aef7bd feature_55

fixed issue with users with no entry in the ssamr_user_details_table. added javascript for those users in the my/account view.
author luisf
date Thu, 03 Feb 2011 15:31:33 +0000
parents bc23796a7120
children f9fe5ef6156e
line wrap: on
line diff
--- a/app/controllers/users_controller.rb	Thu Feb 03 15:15:39 2011 +0000
+++ b/app/controllers/users_controller.rb	Thu Feb 03 15:31:33 2011 +0000
@@ -140,7 +140,11 @@
     
     @ssamr_user_details = @user.ssamr_user_detail
     
-    @selected_institution_id = @user.ssamr_user_detail.institution_id.to_i    
+    if @user.ssamr_user_detail == nil
+      @selected_institution_id = nil
+    else
+      @selected_institution_id = @user.ssamr_user_detail.institution_id.to_i    
+    end
     
     @auth_sources = AuthSource.find(:all)
     @membership ||= Member.new