Skip to content
This repository has been archived by the owner on Jul 25, 2022. It is now read-only.

Commit

Permalink
Add Date serializer to log api. (#667)
Browse files Browse the repository at this point in the history
Currently, the dates on the log page are being returned in the following
format:

2018-07-02T12:30:00.0000

This is a UTC timestamp but it does not include the 'Z' at the end to
indicate that it is UTC. In this case, the time is 8:30:00 EST, but the
browser will treat this ast 12:30 local time because the timezone is not
provided. To fix this, use the date serializer on the log api such that
'Z' is appended to the end of the timestamps.

Signed-off-by: Will Johnson <[email protected]>
  • Loading branch information
johnsonw authored and jgrund committed Jul 3, 2018
1 parent fda3623 commit b22519a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chroma_api/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@


from chroma_core.lib.util import normalize_nid
from chroma_api.utils import DateSerializer

from tastypie import fields
from tastypie.authorization import DjangoAuthorization
Expand Down Expand Up @@ -60,6 +61,7 @@ class Meta:
'tag': ChromaModelResource.ALL_FILTER_STR,
}

serializer = DateSerializer()
authorization = LogAuthorization()
authentication = AnonymousAuthentication()
ordering = ['datetime', 'fqdn']
Expand Down

0 comments on commit b22519a

Please sign in to comment.