summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKelley Spoon <kelley.spoon@linaro.org>2019-01-17 08:17:56 -0600
committerKelley Spoon <kelley.spoon@linaro.org>2019-01-17 08:17:56 -0600
commit8a3b37f5e06fb9d29f3cae0da68002a0355b2235 (patch)
tree2ed60f2a37d6f2669cfb743e9f3f97053350a54e
parent4383d947b0ffa77ed3b01913ad71fbbb0ae7a9ed (diff)
downloadpatchwork-tools-master.tar.gz
alt_email: fix formatting and end_dateHEADmaster
Previous version had a couple of formatting errors: - "email" wasn't started on a new line - "end_date" was over-indented This change also fixes the end_date to use YYYY-MM-DD instead of just str()'ing datetime.now. Change-Id: I20571bff6caa8847a96d360dea297e1bb88e4ce1
-rwxr-xr-xalt_email.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/alt_email.py b/alt_email.py
index 523bfe5..c194835 100755
--- a/alt_email.py
+++ b/alt_email.py
@@ -9,7 +9,7 @@
import sys
import os
-from datetime import datetime
+import time
from jinja2 import Template
import linaro_ldap
from patchwork.models import User
@@ -90,8 +90,8 @@ TMPL = Template(u'''\
enrollments:
- organization: {{ org }}
{%- if end_date %}
- end_date: {{ end_date }}
-{%- endif -%}
+ end_date: {{ end_date }}
+{%- endif %}
email:
{%- for email in emails %}
- {{ email }}
@@ -143,7 +143,7 @@ for user in User.objects.filter(is_active=True):
name = get_name(linaro_email, "displayName")
except NoLdapUserException:
name = user.username
- end_date = str(datetime.now())
+ end_date = time.strftime('%Y-%m-%d', time.localtime())
else:
name = user.username