mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
Added Error to Stylesheet API on invalid CSS
This commit is contained in:
@@ -1281,6 +1281,8 @@ class ApiController(RedditController, OAuth2ResourceController):
|
||||
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()
|
||||
|
||||
@@ -92,6 +92,7 @@ error_list = dict((
|
||||
('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')),
|
||||
|
||||
Reference in New Issue
Block a user