[PATCH 09 of 14] controllers: changeset: always allow status changes

Thomas De Schampheleire patrickdepinguin at gmail.com
Tue Nov 20 20:32:20 UTC 2018


# HG changeset patch
# User Thomas De Schampheleire <thomas.de_schampheleire at nokia.com>
# Date 1541882097 -3600
#      Sat Nov 10 21:34:57 2018 +0100
# Node ID cdb00b730e7ababba77c52198c75384075191b33
# Parent  909dc1223bf73fa46beec48fd5bfccb14a9fd17d
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.

diff --git a/kallithea/controllers/changeset.py b/kallithea/controllers/changeset.py
--- a/kallithea/controllers/changeset.py
+++ b/kallithea/controllers/changeset.py
@@ -388,20 +388,13 @@ class ChangesetController(BaseRepoContro
 
         # 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,


More information about the kallithea-general mailing list