summaryrefslogtreecommitdiff
path: root/chimere/views.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2012-11-23 12:08:34 +0100
committerÉtienne Loks <etienne.loks@peacefrogs.net>2012-11-23 12:18:49 +0100
commit5c5d61cf47e3d9cd872736c337e96a444d9e37fd (patch)
tree8a0753d62f94c9a3804a2ff618495fa8bac4d46d /chimere/views.py
parent4064b6021750d693f905e903378901312a86e6d2 (diff)
downloadChimère-5c5d61cf47e3d9cd872736c337e96a444d9e37fd.tar.bz2
Chimère-5c5d61cf47e3d9cd872736c337e96a444d9e37fd.zip
Fix get_categories empty response
Diffstat (limited to 'chimere/views.py')
-rw-r--r--chimere/views.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/chimere/views.py b/chimere/views.py
index 817aa74..99ecc89 100644
--- a/chimere/views.py
+++ b/chimere/views.py
@@ -549,17 +549,19 @@ def getGeoObjects(request, area_name, category_ids, status):
return HttpResponse(data)
def get_available_categories(request, area_name=None, area=None, status='A',
- force=None):
+ force=None):
'''
Get categories for a designed area
'''
context_data, redir = get_base_response(area_name)
area = context_data["area"]
- if area and area.dynamic_categories and \
- not "current_extent" in request.GET:
- return ""
if redir:
return redir
+ if area and area.dynamic_categories and \
+ not "current_extent" in request.GET:
+ context_data['sub_categories'] = []
+ return render_to_response('chimere/blocks/categories.html', context_data,
+ context_instance=RequestContext(request))
if not area or not area.dynamic_categories:
# Categories are not updated dynamicaly when the user move the map
# so we return ALL the categories