From 273d1bd69256e26757593ebbea407cd6ec242a6a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 08 2016 10:36:23 +0000 Subject: Save the initial_comment when creating a new PR --- diff --git a/pagure/ui/fork.py b/pagure/ui/fork.py index 27f3e05..96595f0 100644 --- a/pagure/ui/fork.py +++ b/pagure/ui/fork.py @@ -936,6 +936,7 @@ def new_request_pull(repo, branch_to, branch_from, username=None): if orig_commit: orig_commit = orig_commit.oid.hex + initial_comment = form.initial_comment.data.strip() or None request = pagure.lib.new_pull_request( SESSION, repo_to=parent, @@ -943,23 +944,11 @@ def new_request_pull(repo, branch_to, branch_from, username=None): branch_from=branch_from, repo_from=repo, title=form.title.data, + initial_comment=initial_comment, user=flask.g.fas_user.username, requestfolder=APP.config['REQUESTS_FOLDER'], ) - if form.initial_comment.data.strip() != '': - pagure.lib.add_pull_request_comment( - SESSION, - request=request, - commit=None, - tree_id=None, - filename=None, - row=None, - comment=form.initial_comment.data.strip(), - user=flask.g.fas_user.username, - requestfolder=APP.config['REQUESTS_FOLDER'], - ) - try: SESSION.commit() except SQLAlchemyError as err: # pragma: no cover