only read affected access restrictions if needed
This commit is contained in:
parent
9ab72b460b
commit
bc1cbc5f24
1 changed files with 1 additions and 3 deletions
|
@ -81,12 +81,10 @@ def tile(request, level, zoom, x, y, access_permissions=None):
|
||||||
access_permissions = set()
|
access_permissions = set()
|
||||||
else:
|
else:
|
||||||
access_permissions = parse_tile_access_cookie(cookie, settings.SECRET_TILE_KEY)
|
access_permissions = parse_tile_access_cookie(cookie, settings.SECRET_TILE_KEY)
|
||||||
|
access_permissions &= set(level_data.restrictions[minx:miny, maxx:maxy])
|
||||||
else:
|
else:
|
||||||
access_permissions = set(int(i) for i in access_permissions.split('-')) - set([0])
|
access_permissions = set(int(i) for i in access_permissions.split('-')) - set([0])
|
||||||
|
|
||||||
# only access permissions that are affecting this tile
|
|
||||||
access_permissions &= set(level_data.restrictions[minx:miny, maxx:maxy])
|
|
||||||
|
|
||||||
# build cache keys
|
# build cache keys
|
||||||
last_update = level_data.history.last_update(minx, miny, maxx, maxy)
|
last_update = level_data.history.last_update(minx, miny, maxx, maxy)
|
||||||
base_cache_key = build_base_cache_key(last_update)
|
base_cache_key = build_base_cache_key(last_update)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue