]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/default_badges/badges.py
adding wrapping divs to user blocks
[osqa.git] / forum_modules / default_badges / badges.py
index 7bc6a2ee59a404d1352720cc6dae9de75cb06305..f9da788d6c5ad434a22f7d7475b90f4ac9e2d014 100644 (file)
@@ -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(
 
     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
 
 
             return action.user
 
 
@@ -294,7 +294,7 @@ class Guru(AbstractBadge):
 
     def award_to(self, action):
         if (action.node.node_type == "answer") and (action.node.accepted) and (
 
     def award_to(self, action):
         if (action.node.node_type == "answer") and (action.node.accepted) and (
-        action.node.score >= int(settings.ENLIGHTENED_UP_VOTES)):
+        action.node.score >= int(settings.GURU_UP_VOTES)):
             return action.node.author
 
 
             return action.node.author
 
 
@@ -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)))
     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):
             return action.node.author
 
 class Taxonomist(AbstractBadge):
@@ -320,3 +320,11 @@ class Taxonomist(AbstractBadge):
     def award_to(self, action):
         return None
 
     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")
+
+    def award_to(self, action):
+        return action.user
\ No newline at end of file