changeset 7430:aee1f11faa8c

controllers: pullrequests: comments are always using AJAX This is preparation to align commenting on changeset and pullrequests.
author Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
date Fri, 16 Nov 2018 21:45:21 +0100
parents 471b29a2f302
children 21edd7f16681
files kallithea/controllers/pullrequests.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/controllers/pullrequests.py	Sat Nov 10 21:35:54 2018 +0100
+++ b/kallithea/controllers/pullrequests.py	Fri Nov 16 21:45:21 2018 +0100
@@ -632,6 +632,7 @@
     @HasRepoPermissionLevelDecorator('read')
     @jsonify
     def comment(self, repo_name, pull_request_id):
+        assert request.environ.get('HTTP_X_PARTIAL_XHR')
         pull_request = PullRequest.get_or_404(pull_request_id)
 
         status = request.POST.get('changeset_status')
@@ -698,9 +699,6 @@
 
         Session().commit()
 
-        if not request.environ.get('HTTP_X_PARTIAL_XHR'):
-            raise HTTPFound(location=pull_request.url())
-
         data = {
            'target_id': h.safeid(h.safe_unicode(request.POST.get('f_path'))),
         }