Permalink
Browse files

subreddit: Add missing error fields and checks.

  • Loading branch information...
andre-d committed Sep 21, 2012
1 parent 44b939d commit 24e518787364a067045d8c58d1f4da7bc96c95b4
Showing with 10 additions and 1 deletion.
  1. +6 −1 r2/r2/controllers/api.py
  2. +4 −0 r2/r2/templates/createsubreddit.html
View
@@ -1570,7 +1570,12 @@ def update_wiki_text(sr):
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
@@ -97,6 +97,8 @@
%if thing.site:
<input type="hidden" name="prev_public_description_id" value="${thing.site.prev_public_description_id}"/>
<input type="hidden" name="prev_description_id" value="${thing.site.prev_description_id}"/>
+ ${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:
<input id="wiki_edit_karma" type="text" name="wiki_edit_karma" value="100" />
%endif
+ ${error_field("BAD_NUMBER", "wiki_edit_karma")}
</div>
<div class="delete-field">
<label for="wiki_edit_age">${_('Account age (days) required to edit and create wiki pages:')}</label>
@@ -183,6 +186,7 @@
%else:
<input id="wiki_edit_age" type="text" name="wiki_edit_age" value="0" />
%endif
+ ${error_field("BAD_NUMBER", "wiki_edit_age")}
</div>
</div>
</%utils:line_field>

0 comments on commit 24e5187

Please sign in to comment.