]> git.openstreetmap.org Git - osqa.git/commitdiff
Fixes some errors that showed up in the logs.
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 31 May 2010 21:35:26 +0000 (21:35 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 31 May 2010 21:35:26 +0000 (21:35 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@347 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/templates/notifications/answeraccepted.html
forum/subscriptions.py
forum_modules/default_badges/badges.py
forum_modules/pgfulltext/handlers.py
settings_local.py.dist

index bdbf79a7012ea46d9712fa563e99df2b6dfe2893..6c3404065be5e97016bc41e33a1a3060f7f23312 100644 (file)
@@ -3,7 +3,7 @@
 {% load extra_tags %}\r
 \r
 {% block content %}\r
-    {% var accepted_by = answer.accepted.by.username %}\r
+    {% var accepted_by = answer.nstate.accepted.by.username %}\r
     {% var answer_author = answer.author.username %}\r
     {% var app_url = settings.APP_URL %}\r
     {% var question_url = question.get_absolute_url %}\r
index 45f430fb78e217ebf1692ab0ebb8d3604de8b273..1ee99e3039655c80037e24b58760984100cceead 100644 (file)
@@ -124,7 +124,7 @@ def answer_accepted(action, new):
             subscription_settings__enable_notifications=True,\r
             subscription_settings__notify_accepted=True,\r
             subscription_settings__subscribed_questions='i'\r
-    ).exclude(id=action.node.accepted.by.id).distinct()\r
+    ).exclude(id=action.node.nstate.accepted.by.id).distinct()\r
     recipients = create_recipients_dict(subscribers)\r
 \r
     send_email(settings.EMAIL_SUBJECT_PREFIX + _("An answer to '%(question_title)s' was accepted") % dict(question_title=question.title),\r
index cb2ed2f69e052f24ea003aaaeb8f5fe01efbe486..e84fcbffa9432f6c71b26b89e5783f25f941f096 100644 (file)
@@ -226,7 +226,7 @@ class Pundit(AbstractBadge):
     description = _('Left %s comments') % settings.PUNDIT_COMMENT_COUNT
 
     def award_to(self, action):
-        if (action.user.nodes.filter(node_type="comment", deleted=None)) == int(settings.CIVIC_DUTY_VOTES):
+        if action.user.nodes.filter_state(deleted=False).filter(node_type="comment").count() == int(settings.CIVIC_DUTY_VOTES):
             return action.user
 
 
index e46c5719ba8a3cf4fddd92971e660ece1ee1d2fe..c8b4e090950de0c888c52553f7281c93b32c92c7 100644 (file)
@@ -1,11 +1,13 @@
+import re
 from django.db.models import Q
 from forum.models.question import Question, QuestionManager
 from forum.modules.decorators import decorate
 
 @decorate(QuestionManager.search, needs_origin=False)
 def question_search(self, keywords):
-    tsquery = " | ".join([k for k in keywords.split(' ') if k])
-    
+    repl_re = re.compile(r'[^\'-_\s\w]')
+    tsquery = " | ".join([k for k in repl_re.sub('', keywords).split(' ') if k])
+
     return self.extra(
                     tables = ['forum_rootnode_doc'],
                     select={
index 053032b10422558ebaf205139d4055ea893de77c..6d0e446708d017463d735cd9a2835da739d01745 100644 (file)
@@ -13,7 +13,7 @@ logging.basicConfig(
 )
 
 #ADMINS and MANAGERS
-ADMINS = (('Forum Admin', 'forum@example.com'),)
+ADMINS = ()
 MANAGERS = ADMINS
 
 DEBUG = False