From 822e68ac16db0ee3314ee9683f4b75484c8ef931 Mon Sep 17 00:00:00 2001 From: kelson Date: Fri, 6 May 2016 16:07:20 -0400 Subject: [PATCH] simplified oneall dname handling --- gluon/contrib/login_methods/oneall_account.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gluon/contrib/login_methods/oneall_account.py b/gluon/contrib/login_methods/oneall_account.py index 0cc43bcc..ae2d0a99 100644 --- a/gluon/contrib/login_methods/oneall_account.py +++ b/gluon/contrib/login_methods/oneall_account.py @@ -51,7 +51,7 @@ class OneallAccount(object): reg_id=profile.get('identity_token','') username=profile.get('preferredUsername',email) first_name=name.get('givenName', dname.split(' ')[0]) - last_name=profile.get('familyName', dname.split(' ')[1] if(len(dname.split(' ')) > 1) else None) + last_name=profile.get('familyName', dname.split(' ')[1] if(dname.count(' ') > 0) else None) return dict(registration_id=reg_id,username=username,email=email, first_name=first_name,last_name=last_name) self.mappings.default = defaultmapping