changeset 8981:ea1a656702ab stable

api: fix get_changeset() when incomplete raw_id is passed with with_reviews Previously, ChangesetStatusModel was queried with the raw_id passed as an argument to the API function. When the raw_id was incomplete (i.e. shortened), no reviews were found. Using the full raw_id from the changeset instance fixes that. Someone might argue that the caller is supposed to pass a full raw_id to the API function. However, in any case, the return value should not be incomplete without notice.
author Manuel Jacob <me@manueljacob.de>
date Wed, 29 Mar 2023 11:05:00 +0200
parents 86b9eed9d105
children a136383459ef
files kallithea/controllers/api/api.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/api/api.py	Wed Jan 18 11:16:06 2023 +0100
+++ b/kallithea/controllers/api/api.py	Wed Mar 29 11:05:00 2023 +0200
@@ -1862,7 +1862,7 @@
 
         if with_reviews:
             reviews = ChangesetStatusModel().get_statuses(
-                                repo.repo_name, raw_id)
+                                repo.repo_name, changeset.raw_id)
             info["reviews"] = reviews
 
         return info