# HG changeset patch # User Thomas De Schampheleire # Date 2020-06-27 20:30:00 # Node ID e24531aa2449703fd85b23dd037bcaab543096c2 # Parent a47f8f57b347fffda1b9b287c1c272b4e838a588 api: extend get_pullrequest data with created_on and updated_on fields The get_pullrequest API call returned most attributes of a pullrequest, but not created_on and updated_on. Set microseconds to 0, as done for modified_at in ChangesetStatus. See commit 71033bd37b4c. diff --git a/kallithea/model/db.py b/kallithea/model/db.py --- a/kallithea/model/db.py +++ b/kallithea/model/db.py @@ -2139,6 +2139,8 @@ class PullRequest(Base, BaseDbModel): status=self.status, comments=self.comments, statuses=self.statuses, + created_on=self.created_on.replace(microsecond=0), + updated_on=self.updated_on.replace(microsecond=0), ) def url(self, **kwargs): diff --git a/kallithea/tests/api/api_base.py b/kallithea/tests/api/api_base.py --- a/kallithea/tests/api/api_base.py +++ b/kallithea/tests/api/api_base.py @@ -2467,6 +2467,8 @@ class _BaseTestApi(object): "statuses": [{"status": "under_review", "reviewer": base.TEST_USER_ADMIN_LOGIN, "modified_at": "2000-01-01T00:00:00"} for i in range(0, len(self.TEST_PR_REVISIONS))], "title": "get test", "revisions": self.TEST_PR_REVISIONS, + "created_on": "2000-01-01T00:00:00", + "updated_on": "2000-01-01T00:00:00", } self._compare_ok(random_id, expected, given=re.sub(br"\d\d\d\d\-\d\d\-\d\dT\d\d\:\d\d\:\d\d",