diff options
author | Leif Johansson <leifj@sunet.se> | 2010-12-12 00:00:13 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2010-12-12 00:00:13 +0100 |
commit | fd143c7c31ab5977874dad0daac3c20d7cab1b9f (patch) | |
tree | 8acef8f106cb13de0c558f8fa915aee920d9a738 /coip/apps/auth/views.py | |
parent | 387e004818f40f2342ab3bf0e15165a2682637de (diff) |
only combine fn+ln if they are nonnull
Diffstat (limited to 'coip/apps/auth/views.py')
-rw-r--r-- | coip/apps/auth/views.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/coip/apps/auth/views.py b/coip/apps/auth/views.py index 29b66c2..97807ca 100644 --- a/coip/apps/auth/views.py +++ b/coip/apps/auth/views.py @@ -38,13 +38,16 @@ def accounts_login_federated(request): if not cn: fn = meta(request,'HTTP_GIVENNAME') ln = meta(request,'HTTP_SN') - cn = "%s %s" % (fn,ln) + if fn and ln: + cn = "%s %s" % (fn,ln) if not cn: cn = profile.identifier mail = meta(request,'HTTP_MAIL') - for attrib_name, meta_value in (('display_name',cn),('email',mail)): + idp = meta(request,'Shib-Identity-Provider') + + for attrib_name, meta_value in (('display_name',cn),('email',mail),('idp',idp)): attrib_value = getattr(profile, attrib_name) if meta_value and not attrib_value: setattr(profile,attrib_name,meta_value) |