mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-27 03:00:12 -04:00
Geotargeting: show the country name rather than just the code.
This commit is contained in:
@@ -3570,13 +3570,14 @@ class RenderableCampaign(Templated):
|
||||
country = campaign.location.country or ''
|
||||
region = campaign.location.region or ''
|
||||
metro = campaign.location.metro or ''
|
||||
pieces = [country, region]
|
||||
|
||||
if metro:
|
||||
metro_str = (g.locations[country]['regions'][region]
|
||||
['metros'][metro]['name'])
|
||||
pieces.append(metro_str)
|
||||
pieces = filter(lambda i: i, pieces)
|
||||
self.geotarget = '/'.join(pieces)
|
||||
self.geotarget = '/'.join([country, region, metro_str])
|
||||
else:
|
||||
self.geotarget = g.locations[country]['name']
|
||||
|
||||
self.country, self.region, self.metro = country, region, metro
|
||||
else:
|
||||
self.geotarget = ''
|
||||
|
||||
Reference in New Issue
Block a user