summaryrefslogtreecommitdiffstats
path: root/askbot/models
diff options
context:
space:
mode:
Diffstat (limited to 'askbot/models')
-rw-r--r--askbot/models/__init__.py15
-rw-r--r--askbot/models/question.py24
2 files changed, 10 insertions, 29 deletions
diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py
index 4092ac2d..7c84cf4a 100644
--- a/askbot/models/__init__.py
+++ b/askbot/models/__init__.py
@@ -32,6 +32,7 @@ from askbot import auth
from askbot.utils.decorators import auto_now_timestamp
from askbot.utils.slug import slugify
from askbot.utils.diff import textDiff as htmldiff
+from askbot.utils.mail import send_mail
from askbot.startup_tests import run_startup_tests
run_startup_tests()
@@ -1619,13 +1620,13 @@ def send_instant_notifications_about_activity_in_post(
)
#todo: this could be packaged as an "action" - a bundle
#of executive function with the activity log recording
- askbot.send_mail(
- subject_line = subject_line,
- body_text = body_text,
- recipient_list = [user.email],
- related_object = origin_post,
- activity_type = const.TYPE_ACTIVITY_EMAIL_UPDATE_SENT
- )
+ send_mail(
+ subject_line = subject_line,
+ body_text = body_text,
+ recipient_list = [user.email],
+ related_object = origin_post,
+ activity_type = const.TYPE_ACTIVITY_EMAIL_UPDATE_SENT
+ )
#todo: move to utils
diff --git a/askbot/models/question.py b/askbot/models/question.py
index 2dff5694..9ab91688 100644
--- a/askbot/models/question.py
+++ b/askbot/models/question.py
@@ -10,8 +10,8 @@ from django.core.urlresolvers import reverse
from django.contrib.sitemaps import ping_google
from django.utils.translation import ugettext as _
import askbot
+import askbot.conf
from askbot.models.tag import Tag, MarkedTag
-from askbot.models import signals
from askbot.models.base import AnonymousContent, DeletableContent, ContentRevision
from askbot.models.base import parse_post_text, parse_and_save_post
from askbot.models import content
@@ -120,7 +120,7 @@ class QuestionManager(models.Manager):
'where': ['text_search_vector @@ to_tsquery(%s)'],
'params': ["'" + search_query + "'"]
}
- if askbot.should_show_sort_by_relevance():
+ if askbot.conf.should_show_sort_by_relevance():
if sort_method == 'relevance-desc':
extra_kwargs['order_by'] = ['-relevance',]
@@ -592,26 +592,6 @@ class Question(content.Content, DeletableContent):
text = text
)
-# def save(self, **kwargs):
-# """
-# Overridden to manually manage addition of tags when the object
-# is first saved.
-#
-# This is required as we're using ``tagnames`` as the sole means of
-# adding and editing tags.
-# """
-# initial_addition = (self.pk is None)
-#
-# super(Question, self).save(**kwargs)
-#
-# if initial_addition:
-# tags = Tag.objects.get_or_create_multiple(
-# self.get_tag_names(),
-# self.author
-# )
-# self.tags.add(*tags)
-# Tag.objects.update_use_counts(tags)
-
def get_tag_names(self):
"""Creates a list of Tag names from the ``tagnames`` attribute."""
return self.tagnames.split(u' ')