changeset 7428:9de5c174a37c

controllers: changeset: always allow status changes Don't disallow status changes on changesets that are part of a pull request and on which the last status change happened via the pull request. This odd restriction was already previously highlighted by Mads Kiilerich as 'RLY?' in commit 7834f845505aec3086f525600c81209a40b495ef, so it seems fair to remove it. When dont_allow_on_closed_pull_request no longer is set, StatusChangeOnClosedPullRequestError will no longer be raised.
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Sat, 10 Nov 2018 21:34:57 +0100
parents 0dac14c83d9f
children 471b29a2f302
files kallithea/controllers/changeset.py
diffstat 1 files changed, 7 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/changeset.py	Sat Nov 10 21:29:29 2018 +0100
+++ b/kallithea/controllers/changeset.py	Sat Nov 10 21:34:57 2018 +0100
@@ -47,7 +47,6 @@
 from kallithea.model.changeset_status import ChangesetStatusModel
 from kallithea.model.meta import Session
 from kallithea.model.repo import RepoModel
-from kallithea.lib.exceptions import StatusChangeOnClosedPullRequestError
 from kallithea.lib.vcs.backends.base import EmptyChangeset
 from kallithea.lib.utils2 import safe_unicode
 from kallithea.lib.graphmod import graph_data
@@ -388,20 +387,13 @@
 
         # get status if set !
         if status:
-            # if latest status was from pull request and it's closed
-            # disallow changing status ! RLY?
-            try:
-                ChangesetStatusModel().set_status(
-                    c.db_repo.repo_id,
-                    status,
-                    request.authuser.user_id,
-                    c.comment,
-                    revision=revision,
-                    dont_allow_on_closed_pull_request=True,
-                )
-            except StatusChangeOnClosedPullRequestError:
-                log.debug('cannot change status on %s with closed pull request', revision)
-                raise HTTPBadRequest()
+            ChangesetStatusModel().set_status(
+                c.db_repo.repo_id,
+                status,
+                request.authuser.user_id,
+                c.comment,
+                revision=revision,
+            )
 
         action_logger(request.authuser,
                       'user_commented_revision:%s' % revision,