check emails
This commit is contained in:
parent
dfda9a0e6d
commit
53ad0d4d01
1 changed files with 10 additions and 2 deletions
|
@ -33,7 +33,7 @@ def api_login(request):
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: {'code': int, 'text': string}
|
status: {'code': 200, 'text': 'ok'}
|
||||||
data: {
|
data: {
|
||||||
errors: {
|
errors: {
|
||||||
username: 'Unknown Username',
|
username: 'Unknown Username',
|
||||||
|
@ -87,6 +87,11 @@ def api_logout(request):
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: {'code': int, 'text': string}
|
status: {'code': int, 'text': string}
|
||||||
|
data: {
|
||||||
|
user: {
|
||||||
|
default user
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
'''
|
'''
|
||||||
response = json_response(text='ok')
|
response = json_response(text='ok')
|
||||||
|
@ -297,6 +302,9 @@ def findUser(request):
|
||||||
#FIXME: support other operators and keys
|
#FIXME: support other operators and keys
|
||||||
data = json.loads(request.POST['data'])
|
data = json.loads(request.POST['data'])
|
||||||
response = json_response(status=200, text='ok')
|
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'])]
|
||||||
|
else:
|
||||||
response['data']['users'] = [u.username for u in User.objects.filter(username__iexact=data['value'])]
|
response['data']['users'] = [u.username for u in User.objects.filter(username__iexact=data['value'])]
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
actions.register(findUser)
|
actions.register(findUser)
|
||||||
|
|
Loading…
Reference in a new issue