From 25f6acad8a2c681b7c659813f20a03f30d79bf3f Mon Sep 17 00:00:00 2001 From: Langenfeld Date: Fri, 8 Nov 2019 11:41:25 +0100 Subject: [PATCH] hacky solution to retrieve tickets of exactly one user of a repo --- gitea/gitea.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gitea/gitea.py b/gitea/gitea.py index 08e1569..8c1e2b8 100644 --- a/gitea/gitea.py +++ b/gitea/gitea.py @@ -266,7 +266,9 @@ class Issue(GiteaApiObject): def get_comments(self) -> List[GiteaApiObject]: results = self.gitea.requests_get(Issue.GET_COMMENTS%(self.owner.username, self.repo)) - return [Comment.parse_request(self.gitea, result) for result in results] + allProjectComments = [Comment.parse_request(self.gitea, result) for result in results] + # Comparing the issue id with the URL seems to be the only (!) way to get to the comments of one issue + return [comment for comment in allProjectComments if comment.issue_url.endswith("/" + str(self.number))] class Branch(GiteaApiObject):