Ticket #5607: 0001-Make-ldap-plugin-python3-compatible.patch

File 0001-Make-ldap-plugin-python3-compatible.patch, 1.3 KB (added by Olivier Mehani, 5 years ago)
  • mediagoblin/plugins/ldap/README.rst

    From 3e75bd4d0c20badce69f1c1a221fcdc3b6618804 Mon Sep 17 00:00:00 2001
    From: Olivier Mehani <shtrom+mediagoblin@ssji.net>
    Date: Tue, 5 May 2020 23:11:26 +1000
    Subject: [PATCH] Make ldap plugin python3 compatible
    
    Signed-off-by: Olivier Mehani <shtrom+mediagoblin@ssji.net>
    ---
     mediagoblin/plugins/ldap/README.rst | 2 +-
     mediagoblin/plugins/ldap/tools.py   | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/mediagoblin/plugins/ldap/README.rst b/mediagoblin/plugins/ldap/README.rst
    index 049b5c4d..fe9a96f5 100644
    a b LDAP server.  
    2626Set up the LDAP plugin
    2727======================
    2828
    29 1. Install the ``python-ldap`` package.
     291. Install the ``python3-ldap`` package.
    3030
    31312. Add the following to your MediaGoblin .ini file in the ``[plugins]`` section::
    3232
  • mediagoblin/plugins/ldap/tools.py

    diff --git a/mediagoblin/plugins/ldap/tools.py b/mediagoblin/plugins/ldap/tools.py
    index 2be2dcd7..9d6d8b2a 100644
    a b class LDAP(object):  
    5757                email = self._get_email(v, username)
    5858                return username, email
    5959
    60             except ldap.LDAPError, e:
     60            except ldap.LDAPError as e:
    6161                _log.info(e)
    6262
    6363            finally: