# HG changeset patch # User Thomas De Schampheleire # Date 2018-11-10 21:05:28 # Node ID b58113063bb25cccbd76ed763e21fe15be65b180 # Parent c6207df9841f34648c1ccd3703c11669e471d965 controllers: changeset: catch status changes on inline comments This is a preparation on sharing the same comment method between pullrequests and changeset controllers. diff --git a/kallithea/controllers/changeset.py b/kallithea/controllers/changeset.py --- a/kallithea/controllers/changeset.py +++ b/kallithea/controllers/changeset.py @@ -369,14 +369,21 @@ class ChangesetController(BaseRepoContro assert request.environ.get('HTTP_X_PARTIAL_XHR') status = request.POST.get('changeset_status') + f_path = request.POST.get('f_path') + line_no = request.POST.get('line') + + if status and (f_path or line_no): + # status votes are only possible in general comments + raise HTTPBadRequest() + text = request.POST.get('text', '').strip() c.comment = create_comment( text, status, revision=revision, - f_path=request.POST.get('f_path'), - line_no=request.POST.get('line'), + f_path=f_path, + line_no=line_no, ) # get status if set !