diff options
author | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-09-26 20:37:49 +0200 |
---|---|---|
committer | Nico von Geyso <Nico.Geyso@FU-Berlin.de> | 2012-09-26 20:37:49 +0200 |
commit | 9a9db2c26e52b84a9d690a20a99524a6ef7377d1 (patch) | |
tree | 42d777315d722caf20a2dd9b083f08f95c89ff46 /account.py | |
parent | de3bd39446aad4e95275b4c0757ef0772671425b (diff) | |
parent | c27e5d3d34d01e9584580ce09e71d29c895b8d49 (diff) | |
download | web-9a9db2c26e52b84a9d690a20a99524a6ef7377d1.tar.gz web-9a9db2c26e52b84a9d690a20a99524a6ef7377d1.tar.bz2 web-9a9db2c26e52b84a9d690a20a99524a6ef7377d1.zip |
Merge branch 'master' of ssh://git.spline.de/account-web
Conflicts:
account.py
Diffstat (limited to 'account.py')
-rw-r--r-- | account.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import ldap from utils import Service +from uuid import uuid4 LDAP_HOST = 'ldap://localhost:5678' @@ -108,12 +109,12 @@ class AccountService: return users[0] def find_by_uid(self, uid, wildcard=False): - return self.find({'uid':uid}, wildcard) + return self.find({'uid': uid}, wildcard) def find_by_mail(self, mail, wildcard=False): - return self.find({'mail':mail}, wildcard) + return self.find({'mail': mail}, wildcard) - def find(self, filters = {}, wildcard=False): + def find(self, filters={}, wildcard=False): """ Find accounts by a given filter with key:value semantic) """ @@ -128,7 +129,7 @@ class AccountService: filterstr = '(&%s)' % filterstr dn = self._format_dn([('ou','users')]) - data = self.connection.search_s(dn,ldap.SCOPE_SUBTREE,filterstr) + data = self.connection.search_s(dn, ldap.SCOPE_SUBTREE, filterstr) accounts = [] for a in data: |