This is an automated email from the ASF dual-hosted git repository. brondsem pushed a commit to branch db/8559 in repository https://gitbox.apache.org/repos/asf/allura.git
commit 91d39a1e72ce4cb10c6bcf7b675f67ce2d171cdb Author: Dave Brondsema <dbronds...@slashdotmedia.com> AuthorDate: Thu May 2 13:14:51 2024 -0400 [#8559] make the ticket "private" field inherit from StringBool like discussion_disabled does --- Allura/allura/lib/validators.py | 3 ++- ForgeTracker/forgetracker/tests/functional/test_rest.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Allura/allura/lib/validators.py b/Allura/allura/lib/validators.py index 50f27834b..ebc72cba9 100644 --- a/Allura/allura/lib/validators.py +++ b/Allura/allura/lib/validators.py @@ -228,10 +228,11 @@ class UserValidator(fev.FancyValidator): return user -class AnonymousValidator(fev.FancyValidator): +class AnonymousValidator(fev.StringBool): def _convert_to_python(self, value, state): from allura.model import User + value = super()._convert_to_python(value, state) if value: if c.user == User.anonymous(): raise fe.Invalid('Log in to Mark as Private', value, state) diff --git a/ForgeTracker/forgetracker/tests/functional/test_rest.py b/ForgeTracker/forgetracker/tests/functional/test_rest.py index 54531aa4e..0606d3e41 100644 --- a/ForgeTracker/forgetracker/tests/functional/test_rest.py +++ b/ForgeTracker/forgetracker/tests/functional/test_rest.py @@ -115,6 +115,8 @@ class TestRestUpdateTicket(TestTrackerApiBase): json = ticket_view.json['ticket'] assert int(json['ticket_num']) == 1 assert json['summary'] == 'test update ticket', json + assert json['discussion_disabled'] is False + assert json['private'] is False class TestRestIndex(TestTrackerApiBase):