From fb827564895c085e85e18c31c3da1724718c83a6 Mon Sep 17 00:00:00 2001 From: Ryan Lerch Date: Sep 24 2018 12:11:01 +0000 Subject: [PATCH 1/2] fix regression where PR comment was not filled in anymore Fixes #3674 --- diff --git a/pagure/templates/repo_new_pull_request.html b/pagure/templates/repo_new_pull_request.html index 378ce6a..49c749b 100644 --- a/pagure/templates/repo_new_pull_request.html +++ b/pagure/templates/repo_new_pull_request.html @@ -194,7 +194,9 @@
+ placeholder="Describe your changes" tabindex=1> + {{- form.initial_comment.data if form.initial_comment.data else '' -}} + {% if form.initial_comment.errors %} From 634186d74b28cfc5752d48a7bb534e08a27ebcaa Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 24 2018 13:02:51 +0000 Subject: [PATCH 2/2] Add a test ensuring the input fields are pre-populated when the PR has only one commit Signed-off-by: Pierre-Yves Chibon --- diff --git a/tests/test_pagure_flask_ui_fork.py b/tests/test_pagure_flask_ui_fork.py index 63656ad..4f2f956 100644 --- a/tests/test_pagure_flask_ui_fork.py +++ b/tests/test_pagure_flask_ui_fork.py @@ -196,7 +196,7 @@ class PagureFlaskForktests(tests.Modeltests): 'refs/heads/%s' % branch_from, author, committer, - 'A commit on branch %s' % branch_from, + 'A commit on branch %s\n\nMore information' % branch_from, tree, [first_commit.oid.hex] ) @@ -1103,6 +1103,7 @@ From: Alice Author Subject: A commit on branch feature +More information --- diff --git a/.gitignore b/.gitignore @@ -1221,6 +1222,7 @@ From: Alice Author Subject: A commit on branch feature +More information --- diff --git a/sources b/sources @@ -2021,6 +2023,17 @@ index 0000000..2a552bb self.assertIn( '\n', output_text) + # Check that we prefilled the input fields as expected: + self.assertIn( + '', + output_text) + self.assertIn( + ''' +
''', output_text) csrf_token = self.get_csrf(output=output)