diff --git a/newsletter/addressimport/parsers.py b/newsletter/addressimport/parsers.py index 483eda45..18202680 100644 --- a/newsletter/addressimport/parsers.py +++ b/newsletter/addressimport/parsers.py @@ -322,14 +322,15 @@ def parse_ldif(myfile, newsletter, ignore_errors=False): Returns a dictionary mapping email addresses into Subscription objects. """ - from ldif3 import LDIFParser + from ldif import LDIFRecordList address_list = AddressList(newsletter, ignore_errors) try: - parser = LDIFParser(myfile) + parser = LDIFRecordList(myfile) + parser.parse() - for dn, entry in parser.parse(): + for dn, entry in parser.all_records: if 'mail' in entry: email = entry['mail'][0] diff --git a/requirements.txt b/requirements.txt index fd00206b..1dc9d096 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ Django>=2.2.16 python-card-me<1.0 -ldif3<3.2 +python-ldap>=3.3.1 chardet unicodecsv<0.15 Pillow