summaryrefslogtreecommitdiff
path: root/chimere
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
parent4064b6021750d693f905e903378901312a86e6d2 (diff)
downloadChimère-5c5d61cf47e3d9cd872736c337e96a444d9e37fd.tar.bz2
Chimère-5c5d61cf47e3d9cd872736c337e96a444d9e37fd.zip
Fix get_categories empty response
Diffstat (limited to 'chimere')
-rw-r--r--chimere/templates/chimere/blocks/categories.html2
-rw-r--r--chimere/views.py10
2 files changed, 8 insertions, 4 deletions
diff --git a/chimere/templates/chimere/blocks/categories.html b/chimere/templates/chimere/blocks/categories.html
index 5ba89fc..8c8a8f8 100644
--- a/chimere/templates/chimere/blocks/categories.html
+++ b/chimere/templates/chimere/blocks/categories.html
@@ -23,7 +23,9 @@
</ul>
</li>
{% endfor %}
+ {% if sub_categories %}
<li id='display_submited'>
<input type='checkbox' name='display_submited' id='display_submited_check'/> {% trans "Display markers and routes waiting for validation"%}
</li>
+ {% endif %}
</ul>
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