Modify /api/submit to return QUOTA_FILLED error when api_type=json.

This commit is contained in:
David Hu
2012-01-04 06:08:25 -08:00
committed by Logan Hanks
parent 827a43027a
commit 07de01a8d8
2 changed files with 2 additions and 0 deletions

View File

@@ -293,6 +293,7 @@ class ApiController(RedditController):
md = safemarkdown(msg)
form.set_html(".status", md)
form.send_failure(errors.QUOTA_FILLED)
return
# well, nothing left to do but submit it

View File

@@ -60,6 +60,7 @@ error_list = dict((
('SUBREDDIT_REQUIRED', _('you must specify a subreddit')),
('BAD_SR_NAME', _('that name isn\'t going to work')),
('RATELIMIT', _('you are doing that too much. try again in %(time)s.')),
('QUOTA_FILLED', _("You've submitted too many links recently. Please try again in an hour.")),
('EXPIRED', _('your session has expired')),
('DRACONIAN', _('you must accept the terms first')),
('BANNED_IP', "IP banned"),