From bfdcff60082798ce373842cdf1b522437ed341a3 Mon Sep 17 00:00:00 2001 From: Andre D Date: Fri, 21 Sep 2012 17:29:27 -0500 Subject: [PATCH] subreddit: Add missing error fields and checks. --- r2/r2/controllers/api.py | 7 ++++++- r2/r2/templates/createsubreddit.html | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/r2/r2/controllers/api.py b/r2/r2/controllers/api.py index 136a82a94..adcbe6161 100755 --- a/r2/r2/controllers/api.py +++ b/r2/r2/controllers/api.py @@ -1570,7 +1570,12 @@ class ApiController(RedditController, OAuth2ResourceController): form.has_errors('public_description', errors.TOO_LONG) or form.has_errors('description', errors.TOO_LONG)): pass - + elif sr and (form.has_errors(('prev_public_description_id', + 'prev_description_id'), errors.TOO_LONG)): + pass + elif (form.has_errors(('wiki_edit_karma', 'wiki_edit_age'), + errors.BAD_NUMBER)): + pass #creating a new reddit elif not sr: #sending kw is ok because it was sanitized above diff --git a/r2/r2/templates/createsubreddit.html b/r2/r2/templates/createsubreddit.html index 5f8c31661..d33c61914 100644 --- a/r2/r2/templates/createsubreddit.html +++ b/r2/r2/templates/createsubreddit.html @@ -97,6 +97,8 @@ %if thing.site: + ${error_field("TOO_LONG", "prev_public_description_id")} + ${error_field("TOO_LONG", "prev_description_id")} %endif <%utils:line_field title="${_('language')}"> @@ -174,6 +176,7 @@ %else: %endif + ${error_field("BAD_NUMBER", "wiki_edit_karma")}
@@ -183,6 +186,7 @@ %else: %endif + ${error_field("BAD_NUMBER", "wiki_edit_age")}