fix contact list bst bug

the api returns UTC timestamps, we should keep them as UTC timestamps
until the very last moment, and only convert them into BST when we know
we want to return to a user (ie: in contact-list.html and other places
like that)
This commit is contained in:
Leo Hemsted
2021-09-14 13:28:27 +01:00
parent 96b91f9e1a
commit 9e915703fd
5 changed files with 7 additions and 19 deletions

View File

@@ -4,7 +4,6 @@ from os import path
from flask import abort, current_app
from notifications_utils.formatters import strip_whitespace
from notifications_utils.recipients import RecipientCSV
from notifications_utils.timezones import utc_string_to_aware_gmt_datetime
from werkzeug.utils import cached_property
from app.models import JSONModel, ModelList
@@ -23,6 +22,7 @@ class ContactList(JSONModel):
ALLOWED_PROPERTIES = {
'id',
'created_at',
'created_by',
'has_jobs',
'recent_job_count',
@@ -115,10 +115,6 @@ class ContactList(JSONModel):
contact_list_id=self.id,
)
@property
def created_at(self):
return utc_string_to_aware_gmt_datetime(self._dict['created_at'])
@property
def contents(self):
return self.download(self.service_id, self.id)