Mercurial > kallithea
changeset 7426:b58113063bb2
controllers: changeset: catch status changes on inline comments
This is a preparation on sharing the same comment method between
pullrequests and changeset controllers.
author | Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> |
---|---|
date | Sat, 10 Nov 2018 21:05:28 +0100 |
parents | c6207df9841f |
children | 0dac14c83d9f |
files | kallithea/controllers/changeset.py |
diffstat | 1 files changed, 9 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/kallithea/controllers/changeset.py Thu Nov 08 21:38:37 2018 +0100 +++ b/kallithea/controllers/changeset.py Sat Nov 10 21:05:28 2018 +0100 @@ -369,14 +369,21 @@ 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 !