forked from OSQA/osqa
-
Notifications
You must be signed in to change notification settings - Fork 624
Expand file tree
/
Copy path__init__.py
More file actions
68 lines (62 loc) · 2.4 KB
/
Copy path__init__.py
File metadata and controls
68 lines (62 loc) · 2.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#import these to compile code and install values
from askbot import const
import askbot
def init():
import askbot.conf.minimum_reputation
import askbot.conf.vote_rules
import askbot.conf.reputation_changes
import askbot.conf.karma_and_badges_visibility
import askbot.conf.email
import askbot.conf.email_text
import askbot.conf.forum_data_rules
import askbot.conf.moderation
import askbot.conf.question_lists
import askbot.conf.flatpages
import askbot.conf.site_settings
import askbot.conf.license
import askbot.conf.external_keys
import askbot.conf.ldap
import askbot.conf.skin_general_settings
import askbot.conf.sidebar_main
import askbot.conf.sidebar_question
import askbot.conf.sidebar_profile
import askbot.conf.leading_sidebar
import askbot.conf.spam_and_moderation
import askbot.conf.user_settings
import askbot.conf.group_settings
import askbot.conf.feedback
import askbot.conf.markup
import askbot.conf.social_sharing
import askbot.conf.badges
import askbot.conf.login_providers
import askbot.conf.access_control
import askbot.conf.site_modes
import askbot.conf.words
import askbot.conf.api_settings
import askbot.conf.rate_limiting
#import main settings object
from askbot.conf.settings_wrapper import settings
def should_show_sort_by_relevance():
"""True if configuration support sorting
questions by search relevance
"""
return ('postgresql_psycopg2' in askbot.get_database_engine_name())
def get_tag_display_filter_strategy_choices():
from askbot.conf import settings as askbot_settings
if askbot_settings.SUBSCRIBED_TAG_SELECTOR_ENABLED:
return const.TAG_DISPLAY_FILTER_STRATEGY_CHOICES
else:
return const.TAG_DISPLAY_FILTER_STRATEGY_MINIMAL_CHOICES
def get_tag_email_filter_strategy_choices():
"""returns the set of choices appropriate for the configuration"""
from askbot.conf import settings as askbot_settings
if askbot_settings.SUBSCRIBED_TAG_SELECTOR_ENABLED:
return const.TAG_EMAIL_FILTER_ADVANCED_STRATEGY_CHOICES
else:
return const.TAG_EMAIL_FILTER_SIMPLE_STRATEGY_CHOICES
def gravatar_enabled():
from django.conf import settings as django_settings
if 'avatar' in django_settings.INSTALLED_APPS:
from askbot.conf import settings as askbot_settings
return askbot_settings.ENABLE_GRAVATAR
return True