File tree Expand file tree Collapse file tree
ietf/mailinglists/management/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010
1111sys .path .append (settings .MAILMAN_LIB_DIR )
1212
13- from Mailman import Utils
14- from Mailman import MailList
15- from Mailman import MemberAdaptor
13+ have_mailman = False
14+ try :
15+ from Mailman import Utils
16+ from Mailman import MailList
17+ from Mailman import MemberAdaptor
18+ have_mailman = True
19+ except ImportError :
20+ pass
1621
1722from ietf .mailinglists .models import List , Subscribed
1823
@@ -22,6 +27,10 @@ def note(msg):
2227 sys .stdout .write (msg )
2328 sys .stdout .write ('\n ' )
2429
30+ if not have_mailman :
31+ note ("Could not import mailman modules -- skipping import of mailman list info" )
32+ return
33+
2534 for name in Utils .list_names ():
2635 mlist = MailList .MailList (name , lock = False )
2736 note ("List: %s" % mlist .internal_name ())
You can’t perform that action at this time.
0 commit comments