Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace the depreciated ldif3 by the actively maintained python-ldap #364

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions newsletter/addressimport/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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