Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix the "clear all flair templates" button for link flair.

  • Loading branch information...
commit 178da70e434f4f4008bcae647592cb17a0ba99a0 1 parent f544a14
Logan Hanks authored
View
8 r2/r2/controllers/api.py
@@ -2385,10 +2385,12 @@ def POST_deleteflairtemplate(self, form, jquery, flair_template):
ModAction.create(c.site, c.user, action='editflair',
details='flair_delete_template')
- @validatedForm(VFlairManager(), VModhash())
+ @validatedForm(VFlairManager(), VModhash(),
+ flair_type = VOneOf('flair_type', (USER_FLAIR, LINK_FLAIR),
+ default=USER_FLAIR))
@api_doc(api_section.flair)
- def POST_clearflairtemplates(self, form, jquery):
- FlairTemplateBySubredditIndex.clear(c.site._id)
+ def POST_clearflairtemplates(self, form, jquery, flair_type):
+ FlairTemplateBySubredditIndex.clear(c.site._id, flair_type=flair_type)
jquery.refresh()
ModAction.create(c.site, c.user, action='editflair',
details='flair_clear_template')
View
1  r2/r2/templates/flairtemplatelist.html
@@ -52,6 +52,7 @@
</div>
<form class="clearflairtemplates"
method="post" action="/api/clearflairtemplates">
+ <input type="hidden" name="flair_type" value="${thing.flair_type}" />
<button class="flairtemplateclear">
${_("clear all flair templates")}
</button>
Please sign in to comment.
Something went wrong with that request. Please try again.