aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/plugins/ldap
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/plugins/ldap')
-rw-r--r--mediagoblin/plugins/ldap/tools.py10
-rw-r--r--mediagoblin/plugins/ldap/views.py2
2 files changed, 6 insertions, 6 deletions
diff --git a/mediagoblin/plugins/ldap/tools.py b/mediagoblin/plugins/ldap/tools.py
index 9d6d8b2a..89ac8c11 100644
--- a/mediagoblin/plugins/ldap/tools.py
+++ b/mediagoblin/plugins/ldap/tools.py
@@ -23,12 +23,12 @@ from mediagoblin.tools import pluginapi
_log = logging.getLogger(__name__)
-class LDAP(object):
+class LDAP:
def __init__(self):
self.ldap_settings = pluginapi.get_config('mediagoblin.plugins.ldap')
def _connect(self, server):
- _log.info('Connecting to {0}.'.format(server['LDAP_SERVER_URI']))
+ _log.info('Connecting to {}.'.format(server['LDAP_SERVER_URI']))
self.conn = ldap.initialize(server['LDAP_SERVER_URI'])
if server['LDAP_START_TLS'] == 'true':
@@ -38,7 +38,7 @@ class LDAP(object):
def _get_email(self, server, username):
try:
results = self.conn.search_s(server['LDAP_SEARCH_BASE'],
- ldap.SCOPE_SUBTREE, 'uid={0}'
+ ldap.SCOPE_SUBTREE, 'uid={}'
.format(username),
[server['EMAIL_SEARCH_FIELD']])
@@ -49,7 +49,7 @@ class LDAP(object):
return email
def login(self, username, password):
- for k, v in six.iteritems(self.ldap_settings):
+ for k, v in self.ldap_settings.items():
try:
self._connect(v)
user_dn = v['LDAP_USER_DN_TEMPLATE'].format(username=username)
@@ -61,7 +61,7 @@ class LDAP(object):
_log.info(e)
finally:
- _log.info('Unbinding {0}.'.format(v['LDAP_SERVER_URI']))
+ _log.info('Unbinding {}.'.format(v['LDAP_SERVER_URI']))
self.conn.unbind()
return False, None
diff --git a/mediagoblin/plugins/ldap/views.py b/mediagoblin/plugins/ldap/views.py
index e10c7f60..99ecb456 100644
--- a/mediagoblin/plugins/ldap/views.py
+++ b/mediagoblin/plugins/ldap/views.py
@@ -44,7 +44,7 @@ def login(request):
if user:
# set up login in session
- request.session['user_id'] = six.text_type(user.id)
+ request.session['user_id'] = str(user.id)
request.session.save()
if request.form.get('next'):