summaryrefslogtreecommitdiffstats
path: root/account.py
diff options
context:
space:
mode:
authorNico von Geyso <Nico.Geyso@FU-Berlin.de>2012-09-26 20:37:49 +0200
committerNico von Geyso <Nico.Geyso@FU-Berlin.de>2012-09-26 20:37:49 +0200
commit9a9db2c26e52b84a9d690a20a99524a6ef7377d1 (patch)
tree42d777315d722caf20a2dd9b083f08f95c89ff46 /account.py
parentde3bd39446aad4e95275b4c0757ef0772671425b (diff)
parentc27e5d3d34d01e9584580ce09e71d29c895b8d49 (diff)
downloadweb-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.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/account.py b/account.py
index 1569e2c..51aabc2 100644
--- a/account.py
+++ b/account.py
@@ -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: