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})
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})
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})
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})
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})
def get(self, request): forget_form = ForgetForm(initial={ 'email': '', 'password': '', 'captcha': '' }) return render(request, 'forgetpwd.html', {'forget_form': forget_form})
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})
def before_request(): g.user = current_user g.login_form = LoginForm() g.search_form = SearchForm() g.form = RegistrationForm() g.forget_form = ForgetForm() g.reset_pwd_form = ResetPasswordForm() g.reset_email_form = ResetEmailForm() g.add_prod_form = AddProdForm()
def get(self, request): forget_form = ForgetForm() return render(request, 'forgetpwd.html', {'forget_form': forget_form})
def get(self, request): forget_form = ForgetForm() return render(request, "forgetpwd.html", {"forget_form": forget_form})