From 47638cc804c084821b2db69e3a2f044da3043d33 Mon Sep 17 00:00:00 2001 From: Renard Date: Mon, 27 Jul 2020 11:53:39 -0400 Subject: Api fix --- cgi/modapi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cgi/modapi.py b/cgi/modapi.py index c1f6319..c2301ab 100644 --- a/cgi/modapi.py +++ b/cgi/modapi.py @@ -94,7 +94,6 @@ def api_process(self, path_split): values['members'] = members elif method == 'stats': report_count = FetchOne("SELECT COUNT(id) FROM `reports`") - values['reportCount'] = report_count try: with open('stats.json', 'r') as f: out = json.load(f) @@ -102,6 +101,7 @@ def api_process(self, path_split): except ValueError: values['stats'] = None raise APIError, "Stats error" + values['stats']['reportCount'] = report_count['COUNT(id)'] else: raise APIError, "Invalid method" -- cgit v1.2.1-18-gbd029