[ARVADOS] updated: 562a420a512bf9ae5fdfb1b564092dc3a011cbcd

git at public.curoverse.com git at public.curoverse.com
Thu Aug 21 18:50:38 EDT 2014


Summary of changes:
 services/api/app/models/user.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

       via  562a420a512bf9ae5fdfb1b564092dc3a011cbcd (commit)
      from  c5ec75eed7fec3fcb70031d684acfc7532ba9996 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 562a420a512bf9ae5fdfb1b564092dc3a011cbcd
Author: radhika <radhika at curoverse.com>
Date:   Thu Aug 21 18:25:16 2014 -0400

    3153: return nil if no unique username can be derived from an email address. no setup will happen in that case.

diff --git a/services/api/app/models/user.rb b/services/api/app/models/user.rb
index b41c7e5..7b894ca 100644
--- a/services/api/app/models/user.rb
+++ b/services/api/app/models/user.rb
@@ -437,7 +437,7 @@ class User < ArvadosModel
       elsif !(/^[a-zA-Z][-._a-zA-Z0-9]{0,30}[a-zA-Z0-9]$/.match(username))
         return true
       else
-        username = derive_unique_username username
+        return true if !(username = derive_unique_username username)
       end
     end
 
@@ -473,7 +473,7 @@ class User < ArvadosModel
 
       username = orig_username + SecureRandom.random_number(1000).to_s
     end
-    return username
+    return nil  # count expired and no unused username was available
   end
 
   # Send notification if the user saved profile for the first time

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list