Create a new constant for datetime formats without timezone

This commit is contained in:
Rebecca Law
2019-12-27 10:26:58 +00:00
parent e9baece3e7
commit 63bdb0208b
5 changed files with 28 additions and 24 deletions

View File

@@ -12,7 +12,7 @@ from notifications_utils.timezones import convert_utc_to_bst
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm.exc import NoResultFound
from app import DATE_FORMAT
from app import DATE_FORMAT, DATETIME_FORMAT_NO_TIMEZONE
from app.config import QueueNames
from app.dao import fact_notification_status_dao, notifications_dao
from app.dao.dao_utils import dao_rollback
@@ -966,7 +966,7 @@ def get_returned_letters(service_id):
# client reference can only be added on API letters
'client_reference': x.client_reference if x.api_key_id else None,
'reported_at': x.reported_at.strftime(DATE_FORMAT),
'created_at': x.created_at.strftime("%Y-%m-%d %H:%M:%S"),
'created_at': x.created_at.strftime(DATETIME_FORMAT_NO_TIMEZONE),
# it doesn't make sense to show hidden/precompiled templates
'template_name': x.template_name if not x.hidden else None,
'template_id': x.template_id if not x.hidden else None,