diff options
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: |