projects
/
mediagoblin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f92018b
)
catch a keyerror
author
Rodney Ewing
<ewing.rj@gmail.com>
Tue, 9 Jul 2013 20:44:26 +0000
(13:44 -0700)
committer
Rodney Ewing
<ewing.rj@gmail.com>
Thu, 15 Aug 2013 23:01:48 +0000
(16:01 -0700)
mediagoblin/plugins/ldap/tools.py
patch
|
blob
|
blame
|
history
diff --git
a/mediagoblin/plugins/ldap/tools.py
b/mediagoblin/plugins/ldap/tools.py
index 35a681ec3b2ca8e177c1b680a213c48c296e59c9..1c43679258b2a2e1b386ecb71012e7cb90892898 100644
(file)
--- a/
mediagoblin/plugins/ldap/tools.py
+++ b/
mediagoblin/plugins/ldap/tools.py
@@
-34,12
+34,12
@@
class LDAP(object):
self.conn.start_tls_s()
def _get_email(self, server, username):
- results = self.conn.search_s(server['LDAP_SEARCH_BASE'],
- ldap.SCOPE_SUBTREE, 'uid={0}'
- .format(username),
- [server['EMAIL_SEARCH_FIELD']])
-
try:
+ results = self.conn.search_s(server['LDAP_SEARCH_BASE'],
+ ldap.SCOPE_SUBTREE, 'uid={0}'
+ .format(username),
+ [server['EMAIL_SEARCH_FIELD']])
+
email = results[0][1][server['EMAIL_SEARCH_FIELD']][0]
except KeyError:
email = None