changeset 8644:e24531aa2449

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.
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Sat, 27 Jun 2020 20:30:00 +0200
parents a47f8f57b347
children a86569aef600
files kallithea/model/db.py kallithea/tests/api/api_base.py
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/model/db.py	Mon Oct 05 21:14:05 2020 +0200
+++ b/kallithea/model/db.py	Sat Jun 27 20:30:00 2020 +0200
@@ -2139,6 +2139,8 @@
             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):
--- a/kallithea/tests/api/api_base.py	Mon Oct 05 21:14:05 2020 +0200
+++ b/kallithea/tests/api/api_base.py	Sat Jun 27 20:30:00 2020 +0200
@@ -2467,6 +2467,8 @@
             "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",