Updated the serialization of Notification.scheduled_for to include minutes.

This commit is contained in:
Rebecca Law
2017-05-24 14:52:32 +01:00
parent 96b0e42959
commit 383dee3bb2
6 changed files with 24 additions and 22 deletions

View File

@@ -30,7 +30,7 @@ from app import (
)
from app.history_meta import Versioned
from app.utils import convert_utc_time_in_bst
from app.utils import convert_utc_time_in_bst, convert_bst_to_utc
SMS_TYPE = 'sms'
EMAIL_TYPE = 'email'
@@ -890,8 +890,9 @@ class Notification(db.Model):
"created_at": self.created_at.strftime(DATETIME_FORMAT),
"sent_at": self.sent_at.strftime(DATETIME_FORMAT) if self.sent_at else None,
"completed_at": self.completed_at(),
"scheduled_for": self.scheduled_notification.scheduled_for.strftime(
"%Y-%m-%d %H") if self.scheduled_notification else None
"scheduled_for": convert_bst_to_utc(self.scheduled_notification.scheduled_for
).strftime(
"%Y-%m-%d %H:%M") if self.scheduled_notification else None
}
return serialized