##// END OF EJS Templates
comments: fix existing ids discovery
marcink -
r4501:c3a98398 stable
parent child Browse files
Show More
@@ -977,6 +977,9 b' class RepoPullRequestsView(RepoAppView, '
977 977 }
978 978 return data
979 979
980 def _get_existing_ids(self, post_data):
981 return filter(lambda e: e, map(safe_int, aslist(post_data.get('comments'), ',')))
982
980 983 @LoginRequired()
981 984 @NotAnonymous()
982 985 @HasRepoPermissionAnyDecorator(
@@ -1013,9 +1016,7 b' class RepoPullRequestsView(RepoAppView, '
1013 1016 self.register_comments_vars(c, pull_request_latest, versions)
1014 1017 all_comments = c.inline_comments_flat + c.comments
1015 1018
1016 existing_ids = filter(
1017 lambda e: e, map(safe_int, aslist(self.request.POST.get('comments'))))
1018
1019 existing_ids = self._get_existing_ids(self.request.POST)
1019 1020 return _render('comments_table', all_comments, len(all_comments),
1020 1021 existing_ids=existing_ids)
1021 1022
@@ -1057,8 +1058,7 b' class RepoPullRequestsView(RepoAppView, '
1057 1058 .get_pull_request_resolved_todos(pull_request)
1058 1059
1059 1060 all_comments = c.unresolved_comments + c.resolved_comments
1060 existing_ids = filter(
1061 lambda e: e, map(safe_int, self.request.POST.getall('comments[]')))
1061 existing_ids = self._get_existing_ids(self.request.POST)
1062 1062 return _render('comments_table', all_comments, len(c.unresolved_comments),
1063 1063 todo_comments=True, existing_ids=existing_ids)
1064 1064
General Comments 0
You need to be logged in to leave comments. Login now