Skip to content

Commit

Permalink
Force translation before putting granularities in cache
Browse files Browse the repository at this point in the history
  • Loading branch information
noirbizarre committed May 6, 2015
1 parent f7a6c21 commit 50e7ec5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion udata/core/spatial/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ def toGeoJSON(self):

@cache.memoize(timeout=50)
def get_spatial_granularities(lang):
return [(l.id, l.name) for l in GeoLevel.objects] + BASE_GRANULARITIES
granularities = [(l.id, l.name) for l in GeoLevel.objects] + BASE_GRANULARITIES
return [(id, str(name)) for id, name in granularities]


spatial_granularities = LocalProxy(lambda: get_spatial_granularities(get_locale()))
Expand Down

0 comments on commit 50e7ec5

Please sign in to comment.