+
+
+@login_required
+def woblink_author_autocomplete(request):
+ session = get_woblink_session()
+ term = request.GET.get('term')
+ if not term:
+ return JsonResponse({})
+ response = session.get(
+ 'https://publisher.woblink.com/author/autocomplete/' + term
+ ).json()
+ return JsonResponse({
+ "results": [
+ {
+ "id": item['autId'],
+ "text": item['autFullname'],
+ }
+ for item in response
+ ],
+ })