Mercurial > kallithea
comparison rhodecode/model/changeset_status.py @ 2771:9640c1c6399b beta
really check if last status is from pull request
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 01 Sep 2012 21:56:56 +0200 |
parents | 4fbbc65e8cd5 |
children | 0b2214604c74 |
comparison
equal
deleted
inserted
replaced
2770:74364824c1e1 | 2771:9640c1c6399b |
---|---|
144 q = q.filter(ChangesetStatus.pull_request == pull_request) | 144 q = q.filter(ChangesetStatus.pull_request == pull_request) |
145 cur_statuses = q.all() | 145 cur_statuses = q.all() |
146 | 146 |
147 #if statuses exists and last is associated with a closed pull request | 147 #if statuses exists and last is associated with a closed pull request |
148 # we need to check if we can allow this status change | 148 # we need to check if we can allow this status change |
149 if (dont_allow_on_closed_pull_request and cur_statuses | 149 if (dont_allow_on_closed_pull_request and cur_statuses |
150 and cur_statuses[0].pull_request.status == PullRequest.STATUS_CLOSED): | 150 and getattr(cur_statuses[0].pull_request, 'status', '') |
151 == PullRequest.STATUS_CLOSED): | |
151 raise StatusChangeOnClosedPullRequestError( | 152 raise StatusChangeOnClosedPullRequestError( |
152 'Changing status on closed pull request is not allowed' | 153 'Changing status on closed pull request is not allowed' |
153 ) | 154 ) |
154 | 155 |
155 if cur_statuses: | 156 if cur_statuses: |