Mercurial > kallithea
changeset 2542:4496d3119627 beta
mock changeset status(to under review) if there's opened pull request but not yet with a status
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 03 Jul 2012 03:27:48 +0200 |
parents | 1c2ba03c42b4 |
children | 03a770980b55 |
files | rhodecode/model/db.py |
diffstat | 1 files changed, 10 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/rhodecode/model/db.py Tue Jul 03 03:07:15 2012 +0200 +++ b/rhodecode/model/db.py Tue Jul 03 03:27:48 2012 +0200 @@ -844,6 +844,16 @@ if revisions: statuses = statuses.filter(ChangesetStatus.revision.in_(revisions)) grouped = {} + + #maybe we have open new pullrequest without a status ? + stat = ChangesetStatus.STATUS_UNDER_REVIEW + status_lbl = ChangesetStatus.get_status_lbl(stat) + for pr in PullRequest.query().filter(PullRequest.org_repo == self).all(): + for rev in pr.revisions: + pr_id = pr.pull_request_id + pr_repo = pr.other_repo.repo_name + grouped[rev] = [stat, status_lbl, pr_id, pr_repo] + for stat in statuses.all(): pr_id = pr_repo = None if stat.pull_request: