Page MenuHomePhabricator
Paste P3249

User.thanks_enabled v2.0
ActivePublic

Authored by darthbhyrava on Jun 15 2016, 3:09 PM.
Referenced Files
F4173278: User.thanks_enabled v2.0
Jun 17 2016, 12:40 AM
F4168704: User.thanks_enabled
Jun 15 2016, 3:09 PM
Subscribers
@property
def thanks_enabled(self):
"""
Determine if the user has thanks notifs enabled.
NOTE: This doesn't accurately determine if thanks is enabled for user.
Privacy of thanks preferences is under discussion, please see
https://phabricator.wikimedia.org/T57401#2216861, and
https://phabricator.wikimedia.org/T120753#1863894
@rtype: bool
"""
return (not (self.isAnonymous()))

Event Timeline

darthbhyrava changed the title of this paste from User.thanks_enabled to User.thanks_enabled v2.0.Jun 17 2016, 12:40 AM
darthbhyrava edited the content of this paste. (Show Details)

You don't need any of those parenthesis... just return not self.isAnonymous() is good enough in Python.