[arvados] created: 2.7.0-5932-g9f487917d8

git repository hosting git at public.arvados.org
Thu Feb 1 21:49:11 UTC 2024


        at  9f487917d8c2aa3958473dd1c11dc584485c1229 (commit)


commit 9f487917d8c2aa3958473dd1c11dc584485c1229
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Thu Feb 1 16:43:06 2024 -0500

    21304: Check for nil from set_initial_username
    
    If set_initial_username comes back as nil (this happens when calling
    update_remote_user on a remote system user), don't set username in
    'needupdate', in order to avoid a spurious user record update.
    
    Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>

diff --git a/services/api/app/models/user.rb b/services/api/app/models/user.rb
index 4d7b2bbaeb..212b0b6ce3 100644
--- a/services/api/app/models/user.rb
+++ b/services/api/app/models/user.rb
@@ -680,8 +680,9 @@ SELECT target_uuid, perm_level
 
       loginCluster = Rails.configuration.Login.LoginCluster
       if user.username.nil? || user.username == ""
-        # Don't have a username yet, set one
-        needupdate[:username] = user.set_initial_username(requested: remote_user[:username])
+        # Don't have a username yet, try to set one
+        initial_username = user.set_initial_username(requested: remote_user[:username])
+        needupdate[:username] = initial_username if !initial_username.nil?
       elsif remote_user_prefix != loginCluster
         # Upstream is not login cluster, don't try to change the
         # username once set.

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list