diff rhodecode/model/scm.py @ 3580:7b9d4f6bb04e beta

show only open pull requests in the counter, and use repo context bar in pull requests view
author Marcin Kuzminski <marcin@python-works.com>
date Sun, 24 Mar 2013 20:24:17 +0100
parents 238486bb71ab
children 35454cd8233b
line wrap: on
line diff
--- a/rhodecode/model/scm.py	Sun Mar 24 19:58:24 2013 +0100
+++ b/rhodecode/model/scm.py	Sun Mar 24 20:24:17 2013 +0100
@@ -393,7 +393,8 @@
     def get_pull_requests(self, repo):
         repo = self._get_repo(repo)
         return self.sa.query(PullRequest)\
-                .filter(PullRequest.other_repo == repo).count()
+                .filter(PullRequest.other_repo == repo)\
+                .filter(PullRequest.status != PullRequest.STATUS_CLOSED).count()
 
     def mark_as_fork(self, repo, fork, user):
         repo = self.__get_repo(repo)