3296: profile config edge cases
[arvados.git] / apps / workbench / app / controllers / application_controller.rb
index fd3a000ecf0980d4b4f430dcd762e0f609f64517..c488023487c93c955bc0fd1016b337ed213f2bb4 100644 (file)
@@ -515,7 +515,9 @@ class ApplicationController < ActionController::Base
   def check_user_profile
     profile_config = Rails.configuration.user_profile_form_fields
 
-    if request.method.downcase != 'get' || params[:partials]
+    if request.method.downcase != 'get' || params[:partial] ||
+       params[:tab_pane] || params[:action_method] ||
+       params[:action] == 'setup_popup'
       return true
     end
 
@@ -525,7 +527,7 @@ class ApplicationController < ActionController::Base
       user_prefs = User.limit(1).where(uuid: current_user.uuid).first.prefs
       current_user_profile = user_prefs[:profile] if user_prefs
 
-      profile_config.andand.each do |entry|
+      profile_config.kind_of?(Array) && profile_config.andand.each do |entry|
         if entry['required']
           if !current_user_profile || !current_user_profile[entry['key'].to_sym]
             missing_required_profile = true