From 5c5d61cf47e3d9cd872736c337e96a444d9e37fd Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 23 Nov 2012 12:08:34 +0100 Subject: Fix get_categories empty response --- chimere/templates/chimere/blocks/categories.html | 2 ++ chimere/views.py | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'chimere') 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 @@ {% endfor %} + {% if sub_categories %}
  • {% trans "Display markers and routes waiting for validation"%}
  • + {% endif %} 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 -- cgit v1.2.3