Permalink
Browse files

subreddit: Add missing error on stylesheet conflict.

  • Loading branch information...
1 parent 24e5187 commit 441ee6ca22b11fc4fc28cb1c12cd66ba885d7df5 @andre-d committed Sep 23, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 r2/r2/controllers/api.py
View
@@ -1264,6 +1264,8 @@ def POST_subreddit_stylesheet(self, form, jquery,
form.set_inputs(prevstyle=str(wr._id))
ModAction.create(c.site, c.user, 'wikirevise', description)
except ConflictException as e:
+ c.errors.add(errors.CONFLICT, field="stylesheet_contents")
+ form.has_errors("stylesheet_contents", errors.CONFLICT)
form.set_html(".status", _('conflict error'))
form.set_html(".errors ul", _('There was a conflict while editing the stylesheet'))
form.find('#conflict_box').show()

0 comments on commit 441ee6c

Please sign in to comment.