]> git.openstreetmap.org Git - osqa.git/blobdiff - forum_modules/default_badges/badges.py
Added a direct option to mark a post as community wiki, still needs some sort of...
[osqa.git] / forum_modules / default_badges / badges.py
index 2305dd4ddc76f3e4f8974bbbce45897ebc6e3747..a04177632a78c7ba826e6002b74e9cb5e7b2b814 100644 (file)
@@ -254,7 +254,7 @@ class Student(AbstractBadge):
     description = _('Asked first question with at least one up vote')
 
     def award_to(self, action):
-        if (action.node.node_type == "question") and (action.node.author.nodes.filter(node_type="question", deleted=None, score=1).count() == 1):
+        if (action.node.node_type == "question") and (action.node.author.nodes.filter_state(deleted=False).filter(node_type="question", score=1).count() == 1):
             return action.node.author
 
 
@@ -265,7 +265,7 @@ class Teacher(AbstractBadge):
     description = _('Answered first question with at least one up vote')
 
     def award_to(self, action):
-        if (action.node.node_type == "answer") and (action.node.author.nodes.filter(node_type="answer", deleted=None, score=1).count() == 1):
+        if (action.node.node_type == "answer") and (action.node.author.nodes.filter_state(deleted=False).filter(node_type="answer", score=1).count() == 1):
             return action.node.author