Exemplo n.º 1
0
 def post(self, request):
     forget_form = ForgetForm(request.POST)
     if forget_form.is_valid():
         email = request.POST.get('email', '')
         send_register_email(email, "forget")
         return render(request, 'send_success.html')
     else:
         return render(request, 'forgetpwd.html',
                       {'forget_form': forget_form})
Exemplo n.º 2
0
 def post(self, request):
     forget_form = ForgetForm(request.POST)
     if forget_form.is_valid():
         email = request.POST.get('email', "")
         send_register_email(email, 'forget')
         return render(request, "send_success.html")
     else:
         return render(request, "forgetpwd.html",
                       {"forget_form": forget_form})
Exemplo n.º 3
0
 def post(self, request):
     forget_form = ForgetForm(request.POST)  # 初始化,判断forget_form是否合法
     if forget_form.is_valid():
         email = request.POST.get("email", "")
         send_register_email(email, "forget")
         return render(request, 'send_success.html')
     else:
         return render(request, 'forgetpwd.html',
                       {"forget_form": forget_form})
Exemplo n.º 4
0
 def post(self, request):
     forget_form = ForgetForm(request.POST)
     if forget_form.is_valid():
         email = request.POST.get("email", "")
         send_status = send_email(email=email, send_type="forget")
         if send_status:
             return render(request, 'send_success.html')
     else:
         return render(request, 'forgetpwd.html',
                       {"forget_form": forget_form})
Exemplo n.º 5
0
 def post(self, request):
     forget_form = ForgetForm(request.POST)
     if forget_form.is_valid():
         email = request.POST.get("email", "")
         # 此处email为申请重置密码的用户账号
         send_register_email(email, "forget")
         return render(request, "send_success.html")
     else:
         return render(request, "forgetpwd.html",
                       {"forget_form": forget_form})
Exemplo n.º 6
0
 def post(self, request):
     forgetform = ForgetForm(request.POST)
     if forgetform.is_valid():
         email = request.POST.get("email", "")
         all_records = UserProfile.objects.filter(email=email)
         if all_records:
             send_register_email(email, "forget")
             return render(request, "send_success.html")
         else:
             return render(request, "forgetpwd.html", {
                 "forgetform": forgetform,
                 "msg": "这个邮箱地址未注册"
             })
     else:
         return render(request, "forgetpwd.html",
                       {"forget_form": forgetform})