mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-25 14:58:27 -05:00
Fix the "clear all flair templates" button for link flair.
This commit is contained in:
@@ -2385,10 +2385,12 @@ class ApiController(RedditController):
|
||||
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')
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user