Move sr discovery links to zookeeper

This change will allow us to change the links without doing a code push
This commit is contained in:
shlurbee
2012-08-08 11:10:45 -07:00
parent a44f6f4c02
commit b1ed5e0f4e
4 changed files with 8 additions and 4 deletions

View File

@@ -496,3 +496,5 @@ beaker.session_secret = somesecret
[live_config]
# make frontpage 100% dart
frontpage_dart = false
# spotlight links for subreddit discovery
sr_discovery_links =

View File

@@ -269,8 +269,8 @@ class HotController(FixListing, ListingController):
# If prefs allow it, mix in promoted links and sr discovery content
if c.user.pref_show_sponsors or not c.user.gold:
if hasattr(g, 'sr_discovery_links'):
spotlight_links.extend(g.sr_discovery_links)
if g.live_config['sr_discovery_links']:
spotlight_links.extend(g.live_config['sr_discovery_links'])
random.shuffle(spotlight_links)
spotlight_keep_fn = lambda l: promote.is_promo(l) or organic.keep_fresh_links(l)
num_links = len(spotlight_links)

View File

@@ -53,7 +53,7 @@ def visible_promo(article):
c.user._id == article.author_id)
# subreddit discovery links are visible even without a live campaign
if article._fullname in getattr(g, 'sr_discovery_links', {}):
if article._fullname in g.live_config['sr_discovery_links']:
return True
# promos are visible only if comments are not disabled and the

View File

@@ -162,7 +162,6 @@ class Globals(object):
'allowed_pay_countries',
'case_sensitive_domains',
'reserved_subdomains',
'sr_discovery_links'
],
ConfigValue.choice: {
@@ -181,6 +180,9 @@ class Globals(object):
ConfigValue.bool: [
'frontpage_dart',
],
ConfigValue.tuple: [
'sr_discovery_links',
],
}
def __init__(self, global_conf, app_conf, paths, **extra):