X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/9e541a9bf9628942b16b60285bb162b7dc98b742..dca62877790867febcd047d0bf7a3ac431ff9c84:/forum_modules/default_badges/badges.py diff --git a/forum_modules/default_badges/badges.py b/forum_modules/default_badges/badges.py index cd160d8..ac02899 100644 --- a/forum_modules/default_badges/badges.py +++ b/forum_modules/default_badges/badges.py @@ -222,7 +222,7 @@ class Pundit(AbstractBadge): def award_to(self, action): if action.user.nodes.filter_state(deleted=False).filter(node_type="comment").count() == int( - settings.CIVIC_DUTY_VOTES): + settings.PUNDIT_COMMENT_COUNT): return action.user @@ -308,7 +308,7 @@ class Necromancer(AbstractBadge): def award_to(self, action): if (action.node.node_type == "answer") and ( action.node.added_at >= (action.node.question.added_at + timedelta(days=int(settings.NECROMANCER_DIF_DAYS))) - ) and (action.node.score == settings.NECROMANCER_UP_VOTES): + ) and (int(action.node.score) == int(settings.NECROMANCER_UP_VOTES)): return action.node.author class Taxonomist(AbstractBadge): @@ -320,3 +320,12 @@ class Taxonomist(AbstractBadge): def award_to(self, action): return None +class ValidatedEmail(AbstractBadge): + type = Badge.BRONZE + listen_to = (EmailValidationAction,) + name = _("Validated Email") + description = _("User who has validated email associated to the account") + award_once = True + + def award_to(self, action): + return action.user \ No newline at end of file