[sysadmin-bin] Don't pull in extra args when send_form_letters is called with just 3 arguments.
- From: Andrea Veri <av src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] Don't pull in extra args when send_form_letters is called with just 3 arguments.
- Date: Thu, 18 Dec 2014 01:39:16 +0000 (UTC)
commit c1c0440f3d718c2472f18f67f65e71a778819b73
Author: Andrea Veri <av gnome org>
Date: Thu Dec 18 02:37:10 2014 +0100
Don't pull in extra args when send_form_letters is called with just 3 arguments.
membership/foundation-operations.py | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
---
diff --git a/membership/foundation-operations.py b/membership/foundation-operations.py
index f1d8c0b..91a72b3 100755
--- a/membership/foundation-operations.py
+++ b/membership/foundation-operations.py
@@ -176,12 +176,21 @@ def send_form_letters(form_letter, email, name, *args):
year_month = str(today.year) + '-' + str(today.month)
try:
- msg = MIMEText(form_letter.safe_substitute (
- cn = name,
- last_renewed_on_date = args[0],
- expired_members = args[0],
- ))
- if form_letter == renewals_to_foundation_list:
+ if form_letter in [renewal_form_letter, new_member_form_letter]:
+ msg = MIMEText(form_letter.safe_substitute (
+ cn = name,
+ ), 'utf8')
+ elif form_letter is expired_membership_form_letter:
+ msg = MIMEText(form_letter.safe_substitute (
+ cn = name,
+ last_renewed_on_date = args[0],
+ ), 'utf8')
+ elif form_letter is renewals_to_foundation_list:
+ msg = MIMEText(form_letter.safe_substitute (
+ expired_members = args[0],
+ ), 'utf8')
+
+ if form_letter is renewals_to_foundation_list:
msg['Subject'] = "Memberships needing renewal (%s)" % year_month
else:
msg['Subject'] = "Your GNOME Foundation Membership"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]