Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="{% url 'send_reset_password_candidato' %}" method="POST" id="validate-restaurar">{% csrf_token %}
- <div class="loader-form-bg">
- <div class="log"></div>
- </div>
- <div class="form-group" id="email_form_modal">
- <input type="email" class="form-control" name="email" placeholder="Ingresa el Email asosciado a tu cuenta" data-validate="email">
- <small class="invalid-feedback text-right">Debe ingresar una cuenta de correo.</small>
- </div>
- <br>
- <button type="submit" class="btn green accent-4 btn-sm btn-lg btn-block rounded-pill text-white">Restaurar</button>
- <br>
- <span class="d-block text-muted text-right mt-3"><a href="" id="ir_login_modal">volver al login </a> </span>
- </form>
- class ResetPasswordCandidato(PasswordResetView):
- model = Usuario
- form_class = FormSolictResePassCandidato
- template_name = 'modals/modal-login.html'
- def post(self, request, *args, **kwargs):
- response_estado = {}
- vEmail = Usuario.objects.filter(email=request.POST.get('email'))
- if vEmail.exists():
- email_template_name = 'email/reset_password_email.html'
- subject_template_name = 'email/password_reset_subject.txt'
- to_email = request.POST.get('email')
- response_estado['email'] = 'send_valid'
- else:
- response_estado['email'] = 'error_Send'
- return JsonResponse(response_estado)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement