X-Git-Url: https://git.openstreetmap.org./osqa.git/blobdiff_plain/a7c18b98d062f773f90be584c61e558713a50d1f..f8e781a472502ff7f6ef1b2b279d752f4fa8620f:/forum/settings/__init__.py?ds=sidebyside diff --git a/forum/settings/__init__.py b/forum/settings/__init__.py index 87b80a1..4120d2b 100644 --- a/forum/settings/__init__.py +++ b/forum/settings/__init__.py @@ -1,18 +1,20 @@ import os.path -from base import Setting, SettingSet +from base import Setting, SettingSet, BaseSetting from django.forms.widgets import Textarea from django.utils.translation import ugettext_lazy as _ from django.conf import settings as djsettings -from django.utils.version import get_svn_revision +from django.utils.version import get_git_changeset + +from forum.modules import get_modules_script_implementations OSQA_VERSION = "Development Build" -SVN_REVISION = get_svn_revision(djsettings.SITE_SRC_ROOT) +VCS_REVISION = get_git_changeset() # We'll have to keep in mind this variable on every release. -if SVN_REVISION == u'SVN-unknown': - SVN_REVISION = u'SVN-1000' +if VCS_REVISION == u'SVN-unknown': + VCS_REVISION = u'SVN-1000' MAINTAINANCE_MODE = Setting('MAINTAINANCE_MODE', None) @@ -25,7 +27,6 @@ APP_BASE_URL = djsettings.APP_BASE_URL FORCE_SCRIPT_NAME = djsettings.FORCE_SCRIPT_NAME OSQA_SKIN = djsettings.OSQA_DEFAULT_SKIN LANGUAGE_CODE = djsettings.LANGUAGE_CODE -ADMIN_MEDIA_PREFIX = djsettings.ADMIN_MEDIA_PREFIX ONLINE_USERS = Setting('ONLINE_USERS', {}) @@ -48,14 +49,15 @@ from urls import * from accept import * from sitemaps import * +__all__ = locals().keys() + # Be able to import all module settings as well -for m in djsettings.MODULE_LIST: - try: - exec 'from %s.settings import *' % m.__name__ - except: - pass +for k,v in get_modules_script_implementations('settings', BaseSetting).items(): + if not k in __all__: + __all__.append(k) + exec "%s = v" % k + BADGES_SET = SettingSet('badges', _('Badges config'), _("Configure badges on your OSQA site."), 500) -#__all__ = locals().keys()