X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/5979e56d461e0e9d8b44d338d1b91175bca0b4de..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 =