# HG changeset patch # User Marcin Kuzminski # Date 2012-09-01 19:56:56 # Node ID 9640c1c6399b9c460030b05002905d62a71766cd # Parent 74364824c1e199fc4bb5d83a6435a755b990e78d really check if last status is from pull request diff --git a/rhodecode/model/changeset_status.py b/rhodecode/model/changeset_status.py --- a/rhodecode/model/changeset_status.py +++ b/rhodecode/model/changeset_status.py @@ -146,8 +146,9 @@ class ChangesetStatusModel(BaseModel): #if statuses exists and last is associated with a closed pull request # we need to check if we can allow this status change - if (dont_allow_on_closed_pull_request and cur_statuses - and cur_statuses[0].pull_request.status == PullRequest.STATUS_CLOSED): + if (dont_allow_on_closed_pull_request and cur_statuses + and getattr(cur_statuses[0].pull_request, 'status', '') + == PullRequest.STATUS_CLOSED): raise StatusChangeOnClosedPullRequestError( 'Changing status on closed pull request is not allowed' )