Advertisement
Guest User

Untitled

a guest
Jul 15th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <form action="{% url 'send_reset_password_candidato' %}" method="POST" id="validate-restaurar">{% csrf_token %}
  2. <div class="loader-form-bg">
  3. <div class="log"></div>
  4. </div>
  5. <div class="form-group" id="email_form_modal">
  6. <input type="email" class="form-control" name="email" placeholder="Ingresa el Email asosciado a tu cuenta" data-validate="email">
  7. <small class="invalid-feedback text-right">Debe ingresar una cuenta de correo.</small>
  8. </div>
  9. <br>
  10. <button type="submit" class="btn green accent-4 btn-sm btn-lg btn-block rounded-pill text-white">Restaurar</button>
  11. <br>
  12. <span class="d-block text-muted text-right mt-3"><a href="" id="ir_login_modal">volver al login </a> </span>
  13. </form>
  14.  
  15. class ResetPasswordCandidato(PasswordResetView):
  16. model = Usuario
  17. form_class = FormSolictResePassCandidato
  18. template_name = 'modals/modal-login.html'
  19.  
  20. def post(self, request, *args, **kwargs):
  21. response_estado = {}
  22. vEmail = Usuario.objects.filter(email=request.POST.get('email'))
  23. if vEmail.exists():
  24. email_template_name = 'email/reset_password_email.html'
  25. subject_template_name = 'email/password_reset_subject.txt'
  26. to_email = request.POST.get('email')
  27.  
  28. response_estado['email'] = 'send_valid'
  29. else:
  30. response_estado['email'] = 'error_Send'
  31.  
  32. return JsonResponse(response_estado)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement