Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Added Error to Stylesheet API on invalid CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
GaeaKat authored and spladug committed Nov 20, 2012
1 parent 82ed3c9 commit 117526a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions r2/r2/controllers/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,8 @@ def POST_subreddit_stylesheet(self, form, jquery,
form.set_html(".status", _('validation errors'))
form.set_html(".errors ul", ''.join(error_items))
form.find('.errors').show()
c.errors.add(errors.BAD_CSS, field="stylesheet_contents")
form.has_errors("stylesheet_contents", errors.BAD_CSS)
return
else:
form.find('.errors').hide()
Expand Down
1 change: 1 addition & 0 deletions r2/r2/controllers/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
('NO_LINKS', _("that reddit only allows text posts")),
('TOO_OLD', _("that's a piece of history now; it's too late to reply to it")),
('BAD_CSS_NAME', _('invalid css name')),
('BAD_CSS', _('invalid css')),
('BAD_REVISION', _('invalid revision ID')),
('TOO_MUCH_FLAIR_CSS', _('too many flair css classes')),
('BAD_FLAIR_TARGET', _('not a valid flair target')),
Expand Down

0 comments on commit 117526a

Please sign in to comment.