コード例 #1
0
def forgot_password(request):
    try:
        success = False
        if request.POST.has_key('username'):
            username = request.POST['username']
            
            Setting.log.info("Forgot password attemp for user:"******"":
                Setting.log.info("Forgot password attemp for user:"******"Forgot password attemp for user:"******"receiving email template")
                (title, text, html) = get_forgot_password_template()

                site_prefix = "www"
                if ( Setting.mode == "beta" ):
                    site_prefix="beta"
                    
                text = text.format("http://"+site_prefix+".yeksatr.com/?forgotPasswordKey="+reset_password_key)
                html = html.format("http://"+site_prefix+".yeksatr.com/?forgotPasswordKey="+reset_password_key)
                
                Setting.log.info("got template - title is "+title)
                sendmail(email, title, text, html)
                Setting.log.info("mail sent to "+email)
                
    except Exception as ex:
        Setting.log.log_exception(ex)

    return Response('')