Skip to content

Commit

Permalink
Check type before converting sync_date into string
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Dellweg authored and ntkathole committed Mar 20, 2019
1 parent ab0a4f9 commit 9dce9ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nailgun/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
_poll_task,
_get_entity_ids,
_payload,
to_json_serializable,
)
from nailgun.entity_mixins import to_json_serializable # noqa: F401

if version_info.major == 2: # pragma: no cover
from httplib import ACCEPTED, NO_CONTENT # pylint:disable=import-error
Expand Down Expand Up @@ -7216,7 +7216,7 @@ def create_payload(self):
"""
data = super(SyncPlan, self).create_payload()
if 'sync_date' in data:
if isinstance(data.get('sync_date'), datetime):
data['sync_date'] = data['sync_date'].strftime('%Y-%m-%d %H:%M:%S')
return data

Expand Down

0 comments on commit 9dce9ed

Please sign in to comment.