# HG changeset patch # User Mads Kiilerich # Date 1441294459 -7200 # Node ID 5be4d7d6ac0507c8f40d1b0dc8ad78e90f3a7897 # Parent c3ecdd622168c27a757081c28406c2a4e57424e9 pull requests: don't filter on repo when finding comments for a PR Filtering on repo while finding comments for a PR would miss some. Fix that. The existing data model is inconsistent; PRs already have two repos and programming errors could easily make the one on a comment wrong. (Revision comments do however need the repo reference.) diff -r c3ecdd622168 -r 5be4d7d6ac05 kallithea/model/comment.py --- a/kallithea/model/comment.py Thu Sep 03 15:40:57 2015 +0200 +++ b/kallithea/model/comment.py Thu Sep 03 17:34:19 2015 +0200 @@ -257,8 +257,7 @@ """ Gets comments for either revision or pull_request_id, either inline or general. """ - q = Session().query(ChangesetComment)\ - .filter(ChangesetComment.repo_id == repo_id) + q = Session().query(ChangesetComment) if inline: q = q.filter(ChangesetComment.line_no != None)\ @@ -268,7 +267,8 @@ .filter(ChangesetComment.f_path == None) if revision: - q = q.filter(ChangesetComment.revision == revision) + q = q.filter(ChangesetComment.revision == revision)\ + .filter(ChangesetComment.repo_id == repo_id) elif pull_request: pull_request = self.__get_pull_request(pull_request) q = q.filter(ChangesetComment.pull_request == pull_request)