From a4a6f8a0a46af97c9fc06361486e03eef7945f99 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 17 2016 17:11:52 +0000 Subject: [PATCH 1/3] Select the branch if there is one set in the form --- diff --git a/pagure/templates/edit_file.html b/pagure/templates/edit_file.html index bb25778..83675d5 100644 --- a/pagure/templates/edit_file.html +++ b/pagure/templates/edit_file.html @@ -77,7 +77,7 @@ From bc3b19678fcba5433b9773611e4b3149cac867f5 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 17 2016 17:11:52 +0000 Subject: [PATCH 2/3] Allow clearing the content of a file online, not just editing it Fixes https://pagure.io/pagure/issue/1461 --- diff --git a/pagure/forms.py b/pagure/forms.py index bbdde4b..21f5bf8 100644 --- a/pagure/forms.py +++ b/pagure/forms.py @@ -525,7 +525,7 @@ class NewGroupForm(EditGroupForm): class EditFileForm(PagureForm): """ Form used to edit a file. """ content = wtforms.TextAreaField( - 'content', [wtforms.validators.Required()]) + 'content', [wtforms.validators.Optional()]) commit_title = wtforms.TextField( 'Title', [wtforms.validators.Required()]) commit_message = wtforms.TextAreaField( From 34e831d83bbe4e2adc95ea0dd15fe29a0d3c0c6d Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Nov 17 2016 17:11:52 +0000 Subject: [PATCH 3/3] Add unit-tests for emptying a file online --- diff --git a/tests/test_pagure_flask_ui_repo.py b/tests/test_pagure_flask_ui_repo.py index 6d905d6..ba90651 100644 --- a/tests/test_pagure_flask_ui_repo.py +++ b/tests/test_pagure_flask_ui_repo.py @@ -2876,6 +2876,30 @@ index 0000000..fb7093d '