From e866cdf0101f6676957fab3f65dd9f9d07629f4b Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sat, 25 Dec 2010 11:46:52 +0530 Subject: [PATCH] return default user --- pandora/user/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora/user/views.py b/pandora/user/views.py index 5a0299a1..1b8ab396 100644 --- a/pandora/user/views.py +++ b/pandora/user/views.py @@ -98,6 +98,9 @@ def api_logout(request): if request.user.is_authenticated(): response = json_response(text='logged out') logout(request) + with open(os.path.join(settings.PROJECT_ROOT, 'templates', 'site.json')) as f: + site = json.load(f) + response['data']['user'] = site['user'] return render_to_json_response(response) actions.register(api_logout, 'logout') @@ -303,7 +306,7 @@ def findUser(request): data = json.loads(request.POST['data']) response = json_response(status=200, text='ok') if data['key'] == 'email': - response['data']['emails'] = [u.username for u in User.objects.filter(email__iexact=data['value'])] + response['data']['users'] = [u.email for u in User.objects.filter(email__iexact=data['value'])] else: response['data']['users'] = [u.username for u in User.objects.filter(username__iexact=data['value'])] return render_to_json_response(response)