mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Fix js_config breaking when tracker_url not configured.
The pageview pixel code expects various things (the base URL, the secret
token, etc.) to be configured. Other places (like base.html) always
check if `g.tracker_url` is valid before generating the pageview pixel.
This was broken in 1f6a9aa570 when
`js_config()` started calling `get_pageview_pixel_url()`
indiscriminately. Ouch for poor open source and dev installs.
This commit is contained in:
@@ -178,7 +178,7 @@ def js_config(extra_config=None):
|
||||
"loading": _("loading...")
|
||||
},
|
||||
"is_fake": isinstance(c.site, FakeSubreddit),
|
||||
"tracker_url": tracking.get_pageview_pixel_url() or '',
|
||||
"tracker_url": "", # overridden below if configured
|
||||
"adtracker_url": g.adtracker_url,
|
||||
"clicktracker_url": g.clicktracker_url,
|
||||
"uitracker_url": g.uitracker_url,
|
||||
@@ -199,6 +199,9 @@ def js_config(extra_config=None):
|
||||
"facebook_app_id": g.live_config["facebook_app_id"],
|
||||
}
|
||||
|
||||
if g.tracker_url:
|
||||
config["tracker_url"] = tracking.get_pageview_pixel_url()
|
||||
|
||||
if g.uncompressedJS:
|
||||
config["uncompressedJS"] = True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user