Ejemplo n.º 1
0
def verifyNewUserCreds(request):
    """Check if user credentials are already used"""
    try :
        from webapp.ttagUtil import isExistingUserName, isExistingEmail
        resp = {}
        # user name check
        user_name = request.POST.get("user_name", False)
        if( user_name ):
            if isExistingUserName(user_name):
                resp["user_name"] = "EXISTS"
            else :
                resp["user_name"] = "OK"
        # email check
        email = request.POST.get("email", False)
        if( email ):
            if isExistingEmail(email):
                resp["email"] = "EXISTS"
            else :
                resp["email"] = "OK"
        return HttpResponse(simplejson.dumps(resp))
    except :
        logger=logging.getLogger(__name__)
        return errorscreen(request,logger, sys)
Ejemplo n.º 2
0
def verifyNewUserCreds(request):
    """Check if user credentials are already used"""
    try:
        from webapp.ttagUtil import isExistingUserName, isExistingEmail
        resp = {}
        # user name check
        user_name = request.POST.get("user_name", False)
        if (user_name):
            if isExistingUserName(user_name):
                resp["user_name"] = "EXISTS"
            else:
                resp["user_name"] = "OK"
        # email check
        email = request.POST.get("email", False)
        if (email):
            if isExistingEmail(email):
                resp["email"] = "EXISTS"
            else:
                resp["email"] = "OK"
        return HttpResponse(simplejson.dumps(resp))
    except:
        logger = logging.getLogger(__name__)
        return errorscreen(request, logger, sys)
Ejemplo n.º 3
0
def isEmailTaken(request):
    from webapp.ttagUtil import isExistingEmail
    email = request.GET.get("email", "*****@*****.**")
    resp = isExistingEmail(email)
    return HttpResponse(simplejson.dumps(resp))