Show More
@@ -735,7 +735,7 b' class MyAccountView(BaseAppView, DataGri' | |||
|
735 | 735 | for pr in pull_requests: |
|
736 | 736 | repo_id = pr.target_repo_id |
|
737 | 737 | comments_count = comments_model.get_all_comments( |
|
738 | repo_id, pull_request=pr, count_only=True) | |
|
738 | repo_id, pull_request=pr, include_drafts=False, count_only=True) | |
|
739 | 739 | owned = pr.user_id == self._rhodecode_user.user_id |
|
740 | 740 | |
|
741 | 741 | data.append({ |
@@ -107,7 +107,8 b' class RepoPullRequestsView(RepoAppView, ' | |||
|
107 | 107 | comments_model = CommentsModel() |
|
108 | 108 | for pr in pull_requests: |
|
109 | 109 | comments_count = comments_model.get_all_comments( |
|
110 |
self.db_repo.repo_id, pull_request=pr, |
|
|
110 | self.db_repo.repo_id, pull_request=pr, | |
|
111 | include_drafts=False, count_only=True) | |
|
111 | 112 | |
|
112 | 113 | data.append({ |
|
113 | 114 | 'name': _render('pullrequest_name', |
@@ -563,7 +563,8 b' class CommentsModel(BaseModel):' | |||
|
563 | 563 | |
|
564 | 564 | return comment |
|
565 | 565 | |
|
566 |
def get_all_comments(self, repo_id, revision=None, pull_request=None, |
|
|
566 | def get_all_comments(self, repo_id, revision=None, pull_request=None, | |
|
567 | include_drafts=True, count_only=False): | |
|
567 | 568 | q = ChangesetComment.query()\ |
|
568 | 569 | .filter(ChangesetComment.repo_id == repo_id) |
|
569 | 570 | if revision: |
@@ -573,6 +574,8 b' class CommentsModel(BaseModel):' | |||
|
573 | 574 | q = q.filter(ChangesetComment.pull_request_id == pull_request.pull_request_id) |
|
574 | 575 | else: |
|
575 | 576 | raise Exception('Please specify commit or pull_request') |
|
577 | if not include_drafts: | |
|
578 | q = q.filter(ChangesetComment.draft == false()) | |
|
576 | 579 | q = q.order_by(ChangesetComment.created_on) |
|
577 | 580 | if count_only: |
|
578 | 581 | return q.count() |
@@ -273,7 +273,7 b" return '%s_%s_%i' % (h.md5_safe(commit+f" | |||
|
273 | 273 | <label for="filediff-collapse-${id(filediff)}" class="filediff-heading"> |
|
274 | 274 | <% |
|
275 | 275 | file_comments = (get_inline_comments(inline_comments, filediff.patch['filename']) or {}).values() |
|
276 | total_file_comments = [_c for _c in h.itertools.chain.from_iterable(file_comments) if not _c.outdated] | |
|
276 | total_file_comments = [_c for _c in h.itertools.chain.from_iterable(file_comments) if not (_c.outdated or _c.draft)] | |
|
277 | 277 | %> |
|
278 | 278 | <div class="filediff-collapse-indicator icon-"></div> |
|
279 | 279 |
General Comments 0
You need to be logged in to leave comments.
Login now