invite/views.py
def check(request):
    """Check to see if username or email address is taken by a user."""
    if request.GET.get('username', None):
        try:
            User.objects.get(username__iexact=request.GET['username'].strip())
            result = True
        except User.DoesNotExist:
            result = False
    elif request.GET.get('email', None):
        try:
            User.objects.get(email__iexact=request.GET['email'].strip())
            result = True
        except User.DoesNotExist:
            result = False
    else:
        result = False
    return JsonResponse({'taken': result})
Check to see if username or email address is taken by a user.
Check to see if username or email address is taken by a user.
Check to see if username or email address is taken by a user .
def check(request):
    if request.GET.get('username', None):
        try:
            User.objects.get(username__iexact=request.GET['username'].strip())
            result = True
        except User.DoesNotExist:
            result = False
    elif request.GET.get('email', None):
        try:
            User.objects.get(email__iexact=request.GET['email'].strip())
            result = True
        except User.DoesNotExist:
            result = False
    else:
        result = False
    return JsonResponse({'taken': result})
def check ( request ) : if request . GET . get ( 'username' , None ) : try : User . objects . get ( username__iexact = request . GET [ 'username' ] . strip ( ) ) result = True except User . DoesNotExist : result = False elif request . GET . get ( 'email' , None ) : try : User . objects . get ( email__iexact = request . GET [ 'email' ] . strip ( ) ) result = True except User . DoesNotExist : result = False else : result = False return JsonResponse ( { 'taken' : result } )
Check to see if username or email address is taken by a user.
Check to see if username or email address is taken by a user .
"""Check to see if username or email address is taken by a user."""
request