summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-05-02 00:07:06 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-05-02 00:07:06 -0400
commit2c7ef628f6632c9f395d5ef3933a5b6b84430947 (patch)
tree42aa753914df914c92c5a947b3a7a9d5f7678d04
parenta0e24ca83fbadd5f4d7a065f76f0df8f638ac7b4 (diff)
downloadaskbot-2c7ef628f6632c9f395d5ef3933a5b6b84430947.tar.gz
askbot-2c7ef628f6632c9f395d5ef3933a5b6b84430947.tar.bz2
askbot-2c7ef628f6632c9f395d5ef3933a5b6b84430947.zip
added option to auto-follow asked question
-rw-r--r--askbot/conf/forum_data_rules.py9
-rw-r--r--askbot/doc/source/changelog.rst1
-rw-r--r--askbot/models/__init__.py4
3 files changed, 14 insertions, 0 deletions
diff --git a/askbot/conf/forum_data_rules.py b/askbot/conf/forum_data_rules.py
index 421bbad7..8f2cf175 100644
--- a/askbot/conf/forum_data_rules.py
+++ b/askbot/conf/forum_data_rules.py
@@ -110,6 +110,15 @@ settings.register(
)
)
+settings.register(
+ livesettings.BooleanValue(
+ FORUM_DATA_RULES,
+ 'AUTO_FOLLOW_QUESTION_BY_OP',
+ default=True,
+ description=_('Auto-follow questions by the Author')
+ )
+)
+
QUESTION_BODY_EDITOR_MODE_CHOICES = (
('open', _('Fully open by default')),
('folded', _('Folded by default'))
diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst
index 38153404..d842db0d 100644
--- a/askbot/doc/source/changelog.rst
+++ b/askbot/doc/source/changelog.rst
@@ -3,6 +3,7 @@ Changes in Askbot
Development version
-------------------
+* Added option to auto-follow questions by the question posters with default "on"
* Support for Django 1.5
* Auto-tweet option for questions and answers
* Added Chech and Croatian translations
diff --git a/askbot/models/__init__.py b/askbot/models/__init__.py
index cb6ccbef..a1a8f636 100644
--- a/askbot/models/__init__.py
+++ b/askbot/models/__init__.py
@@ -1734,6 +1734,10 @@ def user_post_question(
raise ValueError('question.author != self')
question.author = self # HACK: Some tests require that question.author IS exactly the same object as self-user (kind of identity map which Django doesn't provide),
# because they set some attributes for that instance and expect them to be changed also for question.author
+
+ if askbot_settings.AUTO_FOLLOW_QUESTION_BY_OP:
+ self.toggle_favorite_question(question)
+
return question
@auto_now_timestamp