X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5979e56d461e0e9d8b44d338d1b91175bca0b4de..1c5c96529bfa119cad5fef9bcaf260fae0bd305d:/apps/catalogue/views.py?ds=sidebyside diff --git a/apps/catalogue/views.py b/apps/catalogue/views.py index a6f394f21..7f1de6d46 100644 --- a/apps/catalogue/views.py +++ b/apps/catalogue/views.py @@ -491,13 +491,14 @@ def json_tags_starting_with(request, callback=None): if len(prefix) < 2: return HttpResponse('') tags_list = [] - result = "" for tag in _tags_starting_with(prefix, request.user): if not tag.name in tags_list: - result += "\n" + tag.name tags_list.append(tag.name) - dict_result = {"matches": tags_list} - return JSONResponse(dict_result, callback) + if request.GET.get('mozhint', ''): + result = [prefix, tags_list] + else: + result = {"matches": tags_list} + return JSONResponse(result, callback) # ==================== # = Shelf management =