diff --git a/sspromotions/management/commands/sendbulletin.py b/sspromotions/management/commands/sendbulletin.py index 9330bfc..1d41781 100644 --- a/sspromotions/management/commands/sendbulletin.py +++ b/sspromotions/management/commands/sendbulletin.py @@ -33,6 +33,8 @@ import logging import time import urllib.parse +bulldt = timezone.localtime(timezone.now()) + def send_aws_email(client, email, subject, content_html, content_txt): def send_mail(**kwargs): for i in range(0, 10): @@ -91,9 +93,9 @@ class Command(BaseCommand): client = boto3.client('ses', aws_access_key_id=settings.AWS_KEY_ID, aws_secret_access_key=settings.AWS_SECRET, region_name=settings.AWS_REGION) - title = '{} News: {}'.format(settings.ORG_NAME, timezone.localtime(timezone.now()).strftime('%d %B %Y')) + title = '{} News: {}'.format(settings.ORG_NAME, bulldt.strftime('%d %B %Y')) - calbegin, calend, bulbegin, bulend = sspromotions.utils.bulletin_dates(timezone.localtime(timezone.now())) + calbegin, calend, bulbegin, bulend = sspromotions.utils.bulletin_dates(bulldt) events = list(sspromotions.utils.get_calendar_events(calbegin, calend)) for member in members: