[PATCH 10 of 14] model: changeset_status: remove support for 'dont_allow_on_closed_pull_request'
Thomas De Schampheleire
patrickdepinguin at gmail.com
Tue Nov 20 20:32:21 UTC 2018
# HG changeset patch
# User Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
# Date 1541882154 -3600
# Sat Nov 10 21:35:54 2018 +0100
# Node ID 92773b07e1244a8b1896cbf2cfb5941189112bdb
# Parent cdb00b730e7ababba77c52198c75384075191b33
model: changeset_status: remove support for 'dont_allow_on_closed_pull_request'
Previous commit removed the only usage of this parameter.
diff --git a/kallithea/model/changeset_status.py b/kallithea/model/changeset_status.py
--- a/kallithea/model/changeset_status.py
+++ b/kallithea/model/changeset_status.py
@@ -133,7 +133,7 @@ class ChangesetStatusModel(object):
return status
def set_status(self, repo, status, user, comment, revision=None,
- pull_request=None, dont_allow_on_closed_pull_request=False):
+ pull_request=None):
"""
Creates new status for changeset or updates the old ones bumping their
version, leaving the current status at the value of 'status'.
@@ -144,9 +144,6 @@ class ChangesetStatusModel(object):
:param comment:
:param revision:
:param pull_request:
- :param dont_allow_on_closed_pull_request: don't allow a status change
- if last status was for pull request and it's closed. We shouldn't
- mess around this manually
"""
repo = Repository.guess_instance(repo)
@@ -165,15 +162,6 @@ class ChangesetStatusModel(object):
revisions = pull_request.revisions
cur_statuses = q.all()
- # 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 getattr(cur_statuses[0].pull_request, 'status', '')
- == PullRequest.STATUS_CLOSED):
- raise StatusChangeOnClosedPullRequestError(
- 'Changing status on closed pull request is not allowed'
- )
-
# update all current statuses with older version
for st in cur_statuses:
st.version += 1
More information about the kallithea-general
mailing list