aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/model/db.py
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2012-07-03 03:27:48 +0200
committerMarcin Kuzminski <marcin@python-works.com>2012-07-03 03:27:48 +0200
commit466c60cc939bb67beea0b2f183aabfcfc9823623 (patch)
tree3c3df0fafc90b7b2ff1f3fa7d113262c771a36f9 /rhodecode/model/db.py
parent2cc19ac277b0de25cbe1bf4023f28ff9f2502508 (diff)
mock changeset status(to under review) if there's opened pull request but not yet with a status
--HG-- branch : beta
Diffstat (limited to 'rhodecode/model/db.py')
-rwxr-xr-xrhodecode/model/db.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py
index 2a51da45..481dfb52 100755
--- a/rhodecode/model/db.py
+++ b/rhodecode/model/db.py
@@ -844,6 +844,16 @@ class Repository(Base, BaseModel):
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: