diff options
author | Renard | 2019-09-10 23:54:40 -0300 |
---|---|---|
committer | Renard | 2019-09-10 23:54:40 -0300 |
commit | 988f1e5f0f3b1f194c67de6dafd1b5feb23da3f3 (patch) | |
tree | 8d99af11c671fdec22462ce7c3f47b77b8b7d1c0 /cgi | |
parent | 4e99567cbfadf55115a189894eaf382641b5b7da (diff) | |
download | weabot-988f1e5f0f3b1f194c67de6dafd1b5feb23da3f3.tar.gz weabot-988f1e5f0f3b1f194c67de6dafd1b5feb23da3f3.tar.xz weabot-988f1e5f0f3b1f194c67de6dafd1b5feb23da3f3.zip |
API: newThreads
Diffstat (limited to 'cgi')
-rw-r--r-- | cgi/api.py | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -371,6 +371,20 @@ def api_process(self, path_split): values['post_url'] = post_url values['time_taken'] = ttaken + elif method == 'newThreads': + data_limit = formdata.get('limit') + limit = 30 + if data_limit: + try: + limit = int(data_limit) + except ValueError: + raise APIError, "Limit must be numeric" + + if limit > 30: + raise APIError, "Maximum limit is 30" + + threads = getNewThreads(limit) + values['threads'] = threads else: raise APIError, "Invalid method" |