[ARVADOS] created: 1.3.0-3300-gc2565be8a

Git user git at public.arvados.org
Mon Oct 12 19:20:06 UTC 2020


        at  c2565be8a4af26ffe798d9d83d4f4119046f83b4 (commit)


commit c2565be8a4af26ffe798d9d83d4f4119046f83b4
Author: Peter Amstutz <peter.amstutz at curii.com>
Date:   Mon Oct 12 15:18:32 2020 -0400

    16989: Make sure username is valid before trying to create repo
    
    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 f3cf4b38f..34a123e72 100644
--- a/services/api/app/models/user.rb
+++ b/services/api/app/models/user.rb
@@ -224,11 +224,8 @@ SELECT target_uuid, perm_level
     group_perm = create_user_group_link
 
     # Add git repo
-    if repo_name.nil? && username && Rails.configuration.Users.AutoSetupNewUsersWithRepository
-      repo_name = "#{username}/#{username}"
-    end
-
-    repo_perm = if repo_name
+    repo_perm = if (!repo_name.nil? || Rails.configuration.Users.AutoSetupNewUsersWithRepository) and !username.nil?
+                  repo_name ||= "#{username}/#{username}"
                   create_user_repo_link repo_name
                 end
 

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list