这是我的代码:
功能1#此功能工作正常
意见。py公司
def ForgetPassword(request):
if request.method == "POST":
.....my others code
profile_obj = UserProfile.objects.get(user=user_obj)
profile_obj.email_confirmed = False
profile_obj.save()
.....my others code
class ChangePassword_link(View):
#my others code....
if user is not None and account_activation_token.check_token(user, token):
profile_obj = UserProfile.objects.filter(user=user).update(email_confirmed = True)
messages.success(request, ('Your account have been confirmed. Now you can login'))
return redirect('members:change-password-page')
else:
messages.warning(request, ('The confirmation link was invalid, possibly because it has already been used.'))
return redirect('members:change-password-page')
#my others code....