Mark Sapiro pushed to branch master at GNU Mailman / Mailman Core


Commits:
86141989 by Mark Sapiro at 2020-09-26T23:05:14-07:00
Refactor importer to not add/delete non-regexps to *_these_nonmembers.

- - - - -
ce3ed415 by Mark Sapiro at 2020-09-27T06:42:22+00:00
Merge branch 'import' into 'master'

Refactor importer to not add/delete non-regexps to *_these_nonmembers.

Closes #773

See merge request mailman/mailman!709
- - - - -


2 changed files:

- src/mailman/docs/NEWS.rst
- src/mailman/utilities/importer.py


Changes:

=====================================
src/mailman/docs/NEWS.rst
=====================================
@@ -58,6 +58,9 @@ Command line
 * Added a ``charset`` option to the ``import21`` subcommand.  (Closes #769)
 * The ``import21`` subcommand will now truncate long SAUnicode values if the
   database is MySQL.  (Closes #772)
+* The ``import21`` subcommand no longer adds the entire legacy
+  ``*_these_nonmembers`` list and then removes the non-regexps.  It now just
+  adds the regexps.  (Closes #773)
 
 REST
 ----


=====================================
src/mailman/utilities/importer.py
=====================================
@@ -265,9 +265,13 @@ DATETIME_COLUMNS = [
     ]
 
 EXCLUDES = set((
+    'accept_these_nonmembers',
     'delivery_status',
     'digest_members',
+    'discard_these_nonmembers',
+    'hold_these_nonmembers',
     'members',
+    'reject_these_nonmembers',
     'user_options',
     ))
 
@@ -566,10 +570,11 @@ def import_config_pck(mlist, config_dict):
                 action_name = 'defer'
             import_roster(mlist, config_dict, emails, MemberRole.nonmember,
                           Action[action_name])
-            # Only keep the regexes in the legacy list property.
+            # Now add the regexes in the legacy list property.
             list_prop = getattr(mlist, prop_name)
-            for email in emails:
-                list_prop.remove(email)
+            for addr in config_dict.get(prop_name, []):
+                if addr.startswith('^'):
+                    list_prop.append(addr)
     finally:
         mlist.send_welcome_message = send_welcome_message
         mlist.admin_notify_mchanges = admin_notify_mchanges



View it on GitLab: 
https://gitlab.com/mailman/mailman/-/compare/34104ae0960d0234d438cc64e3c150202c25e090...ce3ed415ccd5bd0a11ae4d84e1c109b9985988b2

-- 
View it on GitLab: 
https://gitlab.com/mailman/mailman/-/compare/34104ae0960d0234d438cc64e3c150202c25e090...ce3ed415ccd5bd0a11ae4d84e1c109b9985988b2
You're receiving this email because of your account on gitlab.com.


_______________________________________________
Mailman-checkins mailing list -- mailman-checkins@python.org
To unsubscribe send an email to mailman-checkins-le...@python.org
https://mail.python.org/mailman3/lists/mailman-checkins.python.org/
Member address: arch...@jab.org

Reply via email to