diff roundup/roundupdb.py @ 7575:2b0089104f08

flake8: rename loop variable in 'for sendto in sendto:' Flake8 reported 'B020 Found for loop that reassigns the iterable it is iterating with each iterable value.' Renamed loop variable to to_addr. There is a similar construct with a loop over bcc_sendto with a 'bcc' loop variable. So I assume the loop varaible can be chnaged w/o issue. Codecov shows all the affected lines are being tested and the tests I ran with testmon that should cover that code all passed. We shall see if a full CI run passes.
author John Rouillard <rouilj@ieee.org>
date Sun, 23 Jul 2023 23:40:12 -0400
parents 506c86823abb
children 216662fbaaee
line wrap: on
line diff
--- a/roundup/roundupdb.py	Sun Jul 23 23:28:12 2023 -0400
+++ b/roundup/roundupdb.py	Sun Jul 23 23:40:12 2023 -0400
@@ -577,7 +577,7 @@
         # can't fiddle the recipients in the message ... worth testing
         # and/or fixing some day
         first = True
-        for sendto in sendto:
+        for to_addr in sendto:
             # create the message
             mailer = Mailer(self.db.config)
 
@@ -721,18 +721,18 @@
                 message.set_payload(body, message.get_charset())
 
             if crypt:
-                send_msg = self.encrypt_to(message, sendto)
+                send_msg = self.encrypt_to(message, to_addr)
             else:
                 send_msg = message
-            mailer.set_message_attributes(send_msg, sendto, subject, author)
+            mailer.set_message_attributes(send_msg, to_addr, subject, author)
             if crypt:
                 send_msg['Message-Id'] = message['Message-Id']
                 send_msg['Reply-To'] = message['Reply-To']
                 if message.get('In-Reply-To'):
                     send_msg['In-Reply-To'] = message['In-Reply-To']
 
-            if sendto:
-                mailer.smtp_send(sendto, send_msg.as_string())
+            if to_addr:
+                mailer.smtp_send(to_addr, send_msg.as_string())
             if first:
                 if crypt:
                     # send individual bcc mails, otherwise receivers can

Roundup Issue Tracker: http://roundup-tracker.org/