Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update set_flair parameter names to match the names in the flairlist …

…dictionary.
  • Loading branch information...
commit f078ef02924f97daad693e1bf207f5eab723e810 1 parent a242990
Bryce Boe bboe authored
Showing with 7 additions and 3 deletions.
  1. +7 −3 reddit/__init__.py
10 reddit/__init__.py
View
@@ -410,12 +410,16 @@ def get_stylesheet(self, subreddit):
six.text_type(subreddit))['data']
@reddit.decorators.require_login
- def set_flair(self, subreddit, user, text='', css_class=''):
+ def set_flair(self, subreddit, user, flair_text='', flair_css_class=''):
"""Set flair of user in given subreddit."""
+ if flair_text == None:
+ flair_text = ''
+ if flair_css_class == None:
+ flair_css_class = ''
params = {'r': six.text_type(subreddit),
'name': six.text_type(user),
- 'text': text,
- 'css_class': css_class}
+ 'text': flair_text,
+ 'css_class': flair_css_class}
response = self.request_json(self.config['flair'], params)
stale_url = self.config['flairlist'] % six.text_type(subreddit)
# pylint: disable-msg=E1101,W0212
Please sign in to comment.
Something went wrong with that request. Please try again.