UserGet() passes "select" option along to batch update refs #16914
[arvados.git] / services / api / app / models / api_client_authorization.rb
index 76b722694aa763baeb79a2ce621c620383c139a2..518fe569377ab1b2c2b21880e4f3411aa340844a 100644 (file)
@@ -268,14 +268,12 @@ class ApiClientAuthorization < ArvadosModel
       end
 
       act_as_system_user do
-        user.save!
-
         if (user.is_active && !remote_user['is_active']) or (user.is_invited && !remote_user['is_invited'])
-          # If the user is newly created and AutoSetupNewUsers is
-          # true, they will auto-setup in an after_create hook.
-          # Synchronize the user's "active/invited" state state after the record
-          # has been saved.
+          # Synchronize the user's "active/invited" state state.  This
+          # also saves the record.
           user.unsetup
+        else
+          user.save!
         end
 
         # We will accept this token (and avoid reloading the user