]> nos-oignons.net Git - gestion-adh.git/blobdiff - lib/nos_oignons.rb
Mise à jour de la documentation
[gestion-adh.git] / lib / nos_oignons.rb
index 26ffdc63e09b25e9eed5349246a6b4ef23c70c28..ff387d1af21b6ca32b2dc33deb0a09e70eaf7fb6 100644 (file)
@@ -26,8 +26,10 @@ module NosOignons
       current_emails = NosOignons::Mailman.list_members(list)
       uptodate_emails = NosOignons::Member.all.select(&:up_to_date?).collect(&:email)
 
       current_emails = NosOignons::Mailman.list_members(list)
       uptodate_emails = NosOignons::Member.all.select(&:up_to_date?).collect(&:email)
 
-      NosOignons::Mailman.add_members(list, uptodate_emails - current_emails)
-      NosOignons::Mailman.remove_members(list, current_emails - uptodate_emails)
+      emails_to_add = uptodate_emails - current_emails
+      NosOignons::Mailman.add_members(list, emails_to_add) unless emails_to_add.empty?
+      emails_to_remove = current_emails - uptodate_emails
+      NosOignons::Mailman.remove_members(list, emails_to_remove) unless emails_to_remove.empty?
     end
 
     def send_membership_reminders!
     end
 
     def send_membership_reminders!