changeset 187:752184172a34 cannam-pre-20110113-merge

Merge from branch "feature_55"
author Chris Cannam
date Thu, 03 Feb 2011 15:34:57 +0000
parents 011f2ec6018f (current diff) 594ed6aef7bd (diff)
children b55279e641b8
files
diffstat 3 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/app/controllers/my_controller.rb	Thu Feb 03 15:34:42 2011 +0000
+++ b/app/controllers/my_controller.rb	Thu Feb 03 15:34:57 2011 +0000
@@ -54,8 +54,6 @@
     @pref = @user.pref
     @ssamr_user_details = @user.ssamr_user_detail
     
-    @selected_institution_id = @ssamr_user_details.institution_id.to_i
-    
     if request.post?
       @user.attributes = params[:user]
       @user.mail_notification = params[:notification_option] || 'only_my_events'
@@ -65,8 +63,10 @@
       if @user.ssamr_user_detail == nil
         @ssamr_user_details = SsamrUserDetail.new()
         @user.ssamr_user_detail = @ssamr_user_details
+        @selected_institution_id = NULL
       else
         @ssamr_user_details = @user.ssamr_user_detail
+        @selected_institution_id = @ssamr_user_details.institution_id.to_i
       end
 
 
--- a/app/controllers/users_controller.rb	Thu Feb 03 15:34:42 2011 +0000
+++ b/app/controllers/users_controller.rb	Thu Feb 03 15:34:57 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
--- a/app/views/my/account.rhtml	Thu Feb 03 15:34:42 2011 +0000
+++ b/app/views/my/account.rhtml	Thu Feb 03 15:34:57 2011 +0000
@@ -1,4 +1,6 @@
 <%= javascript_include_tag "ssamr_institutions" %>
+<%= javascript_include_tag "ssamr_registration" %>
+
 
 
 <div class="contextual">