X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/a9a1ca6bcebfe9744a2ece973d69a79928b1b938..42dee4014c452c1f9f6b29891bca9800e5ad3528:/apps/catalogue/views.py?ds=inline 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 =