summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-12-12 19:23:17 -0300
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2013-12-12 19:23:17 -0300
commit1a5e46beff690c72de540a1358d25215dc43eb6a (patch)
treeabc8c92236927bcd730e0b73504a7cf05d562e0f
parentf2f5275e5a1e0dd4ca910ce3a2c33950ed2828f1 (diff)
parenta8b0a2aff466153a2da325ff076d6a9ace6524c4 (diff)
downloadaskbot-1a5e46beff690c72de540a1358d25215dc43eb6a.tar.gz
askbot-1a5e46beff690c72de540a1358d25215dc43eb6a.tar.bz2
askbot-1a5e46beff690c72de540a1358d25215dc43eb6a.zip
Merge branch 'master' into merge-osqa
-rw-r--r--askbot/conf/settings_wrapper.py13
-rw-r--r--askbot/doc/source/changelog.rst7
-rw-r--r--askbot/doc/source/live-settings.rst17
-rw-r--r--askbot/management/commands/fix_question_tags.py2
4 files changed, 36 insertions, 3 deletions
diff --git a/askbot/conf/settings_wrapper.py b/askbot/conf/settings_wrapper.py
index 601ced92..7fc9540d 100644
--- a/askbot/conf/settings_wrapper.py
+++ b/askbot/conf/settings_wrapper.py
@@ -20,6 +20,7 @@ at run time
askbot.deps.livesettings is a module developed for satchmo project
"""
+from django.conf import settings as django_settings
from django.core.cache import cache
from askbot.deps.livesettings import SortedDotDict, config_register
from askbot.deps.livesettings.functions import config_get
@@ -47,7 +48,11 @@ class ConfigSettings(object):
will be required in code to convert an app
depending on django.conf.settings to askbot.deps.livesettings
"""
- return getattr(self.__instance, key).value
+ hardcoded_setting = getattr(django_settings, 'ASKBOT_' + key, None)
+ if hardcoded_setting is None:
+ return getattr(self.__instance, key).value
+ else:
+ return hardcoded_setting
def get_default(self, key):
"""return the defalut value for the setting"""
@@ -108,7 +113,11 @@ class ConfigSettings(object):
out = dict()
for key in cls.__instance.keys():
#todo: this is odd that I could not use self.__instance.items() mapping here
- out[key] = cls.__instance[key].value
+ hardcoded_setting = getattr(django_settings, 'ASKBOT_' + key, None)
+ if hardcoded_setting is None:
+ out[key] = cls.__instance[key].value
+ else:
+ out[key] = hardcoded_setting
cache.set(cache_key, out)
diff --git a/askbot/doc/source/changelog.rst b/askbot/doc/source/changelog.rst
index 6287a20e..b20a3313 100644
--- a/askbot/doc/source/changelog.rst
+++ b/askbot/doc/source/changelog.rst
@@ -1,6 +1,13 @@
Changes in Askbot
=================
+Development master branch (only on github)
+------------------------------------------
+
+* Management command to add data from other Askbot site.
+* Allowed simple overrides of livesettings with `ASKBOT_...` prefixed
+ variables in the `settings.py` file
+
0.7.49 (Sep 19, 2013)
---------------------
* Support for Solr search backend (Adolfo)
diff --git a/askbot/doc/source/live-settings.rst b/askbot/doc/source/live-settings.rst
index 12546e6c..bc0d3d72 100644
--- a/askbot/doc/source/live-settings.rst
+++ b/askbot/doc/source/live-settings.rst
@@ -24,7 +24,22 @@ Entering live settings in settings.py file
==========================================
You might want to bypass live settings and enter them directly
-in the ``settings.py`` file in the ``LIVESETTINGS_OPTIONS`` dictionary.
+in the ``settings.py`` file.
+
+Currently there are two ways to do this:
+
+1. Simply add variable with the same name as defined in `askbot/conf` files,
+ but prefixed with `ASKBOT_` and the corresponding value.
+ For example, add `ASKBOT_RSS_ENABLED = False` to disable the rss.
+ In `askbot/conf` this value is defined simply as `RSS_ENABLED`.
+
+2. Put settings into the ``LIVESETTINGS_OPTIONS`` dictionary,
+ this way you can assign livesettings values to specific site by ID,
+ which may or may not be useful for the multi-portal (multi-site) askbot setup.
+
+The first method above overrides the second.
+
+Here is a more detailed description on how to use the `LIVESETTINGS_OPTIONS` method:
Having live settings overridden from the ``settings.py`` file may
somewhat speed up your site
diff --git a/askbot/management/commands/fix_question_tags.py b/askbot/management/commands/fix_question_tags.py
index ed1ee6fb..72d67bc3 100644
--- a/askbot/management/commands/fix_question_tags.py
+++ b/askbot/management/commands/fix_question_tags.py
@@ -28,12 +28,14 @@ class Command(NoArgsCommand):
print dupes[idx].name + ' ',
dupes[idx].delete()
print ''
+ #todo: see if we can use the tag "clean" procedure here
if askbot_settings.FORCE_LOWERCASE_TAGS:
lowercased_name = first_tag.name.lower()
if first_tag.name != lowercased_name:
print 'Converting tag %s to lower case' % first_tag.name
first_tag.name = lowercased_name
first_tag.save()
+
transaction.commit()
#go through questions and fix tag records on each