You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by ke...@apache.org on 2022/02/01 22:01:55 UTC

[allura] 01/01: Prevent discussion stats endpoint from 500ing if hit without parameters

This is an automated email from the ASF dual-hosted git repository.

kentontaylor pushed a commit to branch kt/discussion-stats
in repository https://gitbox.apache.org/repos/asf/allura.git

commit dc9c5b4757000251ea88f3057ac8c6c95b47b71d
Author: Kenton Taylor <kt...@slashdotmedia.com>
AuthorDate: Tue Feb 1 22:01:34 2022 +0000

    Prevent discussion stats endpoint from 500ing if hit without parameters
---
 ForgeDiscussion/forgediscussion/controllers/root.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/ForgeDiscussion/forgediscussion/controllers/root.py b/ForgeDiscussion/forgediscussion/controllers/root.py
index 29266fc..742fd9c 100644
--- a/ForgeDiscussion/forgediscussion/controllers/root.py
+++ b/ForgeDiscussion/forgediscussion/controllers/root.py
@@ -219,9 +219,9 @@ class RootController(BaseController, DispatchIndex, FeedController):
 
     @expose('json:')
     @validate(dict(
-        begin=h.DateTimeConverter(if_empty=None, if_invalid=None),
-        end=h.DateTimeConverter(if_empty=None, if_invalid=None),
-    ))
+        begin=h.DateTimeConverter(not_empty=True),
+        end=h.DateTimeConverter(not_empty=True),
+    ), error_handler=stats)
     def stats_data(self, begin=None, end=None, forum=None, **kw):
         end = end or date.today()
         begin = begin or end - timedelta(days=60)