Permalink
Browse files

Move sr discovery links to zookeeper

This change will allow us to change the links without doing a code push
  • Loading branch information...
1 parent a44f6f4 commit b1ed5e0f4e35a569074699f49598b568d99714dd @shlurbee shlurbee committed Aug 8, 2012
View
@@ -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 =
@@ -269,8 +269,8 @@ def spotlight(self):
# 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)
@@ -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
@@ -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):

0 comments on commit b1ed5e0

Please sign in to comment.