From 5f96597bb9a2e6a21260f37763e98120d9dcdc79 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 13 2017 15:57:53 +0000 Subject: [PATCH 1/4] Make the priorities be sorted by default --- diff --git a/pagure/templates/settings.html b/pagure/templates/settings.html index 1836852..b95ad95 100644 --- a/pagure/templates/settings.html +++ b/pagure/templates/settings.html @@ -582,7 +582,7 @@
- {% for priority in repo.priorities or [""] | sort %} + {% for priority in ((repo.priorities or []) | sort) %}
Date: Feb 13 2017 15:57:53 +0000 Subject: [PATCH 2/4] Test for randomsort issue (#1887) Signed-off-by: Patrick Uiterwijk Signed-off-by: Pierre-Yves Chibon --- diff --git a/tests/test_pagure_flask_ui_priorities.py b/tests/test_pagure_flask_ui_priorities.py index f73a0ae..9666b0a 100644 --- a/tests/test_pagure_flask_ui_priorities.py +++ b/tests/test_pagure_flask_ui_priorities.py @@ -216,6 +216,11 @@ class PagureFlaskPrioritiestests(tests.Modeltests): self.assertIn( 'Settings - test - Pagure', output.data) self.assertIn('

Settings for test

', output.data) + # Check the ordering + self.assertTrue( + output.data.find('High') < output.data.find('Normal')) + self.assertTrue( + output.data.find('Normal') < output.data.find('Low')) # Check the result of the action -- Priority recorded repo = pagure.lib.get_project(self.session, 'test') self.assertEqual( From 96f5311654322a7eadc0e3e5e74c9dd507cdf318 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 13 2017 15:57:53 +0000 Subject: [PATCH 3/4] Drop trailing space --- diff --git a/pagure/templates/settings.html b/pagure/templates/settings.html index b95ad95..2a43950 100644 --- a/pagure/templates/settings.html +++ b/pagure/templates/settings.html @@ -272,7 +272,7 @@

The email addresses entered below will receive all the notifications related to {% if config.get('ENABLE_TICKETS', True) %} - (public) issue and {% endif %}pull-requests, this includes + (public) issue and {% endif %}pull-requests, this includes notifications about {% if config.get('ENABLE_TICKETS', True) %} new issue or {% endif %} new pull-request, new comment and status change. From 00d0f40216c703b6727f397fc69f8e7dcbfad1e7 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 13 2017 17:30:44 +0000 Subject: [PATCH 4/4] Fix grammar error --- diff --git a/pagure/templates/settings.html b/pagure/templates/settings.html index 2a43950..0e3856b 100644 --- a/pagure/templates/settings.html +++ b/pagure/templates/settings.html @@ -272,7 +272,7 @@

The email addresses entered below will receive all the notifications related to {% if config.get('ENABLE_TICKETS', True) %} - (public) issue and {% endif %}pull-requests, this includes + (public) issues and {% endif %}pull-requests, this includes notifications about {% if config.get('ENABLE_TICKETS', True) %} new issue or {% endif %} new pull-request, new comment and status change.