Created
August 7, 2020 19:30
-
-
Save linikerunk/779b0eb9d18ab328d950c8bdab3a6635 to your computer and use it in GitHub Desktop.
Reset-senha
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% extends 'base.html' %} | |
| {% load static %} | |
| {% load bootstrap %} | |
| {% block titulo %} Restauração de Senha {% endblock %} | |
| {% block conteudo %} | |
| <div class="row"> | |
| <div class="col-md-8 offset-md-2"> | |
| <h3>Restaurar sua Senha </h3> | |
| <hr> | |
| </div> | |
| <div class="form-group col-md-8 offset-md-2" id="reset-password"> | |
| <form method="POST" enctype="multipart/form-data" action="{% url 'perfil:reset_password' %}"> | |
| {% csrf_token %} | |
| <p> Nova Senha: </p> | |
| <input type="text" class="form-control" name="new_password1" id="id_new_password1"> | |
| <p> Confirmação de Nova Senha : </p> | |
| <input type="text" class="form-control" name="new_password2" id="id_new_password2"> | |
| <button class="btn btn-success float-right mt-3 w-25" type="submit">Enviar</button> | |
| <div class="mb-5"></div> | |
| </form> | |
| </div> | |
| {% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {% extends 'base.html' %} | |
| {% load static %} | |
| {% load bootstrap %} | |
| {% block titulo %} Restauração de Senha {% endblock %} | |
| {% block conteudo %} | |
| <div class="row"> | |
| <div class="col-md-8 offset-md-2"> | |
| <h3>Restaurar sua Senha </h3> | |
| <hr> | |
| </div> | |
| <form method="POST" enctype="multipart/form-data" action="{% url 'perfil:reset_password user.username'%}"> | |
| {% csrf_token %} | |
| <div id="tela-verificacao" class="row"> | |
| <div class="form-group col-md-8 offset-md-2"> | |
| <p> Selecione sua Unidade : </p> | |
| <select id="unidade" name="unidade" class="select form-control form-control"> | |
| <option value="" selected="">----------</option> | |
| {% for unidade in unidade %} | |
| <option value="{{ unidade.id }}"> {{ unidade }}</option> | |
| {% endfor %} | |
| </select> | |
| </div> | |
| <div class="form-group col-md-8 offset-md-2"> | |
| <p> Digite seu número de registro : </p> | |
| <input type="text" id="funcionario-login-reset" name="funcionario-login-reset" class="form-control"> | |
| </div> | |
| <div class="form-group col-md-8 offset-md-2"> | |
| <p> Login : </p> | |
| <input type="text" id="username" name="id_username" class="form-control"> | |
| </div> | |
| <div class="form-group col-md-8 offset-md-2"> | |
| <p> Qual a data de sua admissão : </p> | |
| <input type="text" id="admissao" name="admissao" class="form-control" data-mask="00/00/0000" placeholder="DD/MM/AAAA"> | |
| </div> | |
| <div class="form-group col-md-8 offset-md-2"> | |
| <a href="{% url 'chamados:enviar' %}" class="btn btn-warning ml-3 float-right w-25" role="button">Voltar</a> | |
| <button type="submit" id="send-answer" class="btn btn-success ml-3 float-right w-25">Enviar</button> | |
| </div> | |
| </div> | |
| {% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def verifica_admissao(request): | |
| unidade = Unidade.objects.all() | |
| form = VerificaAdmissao(request.POST or None) | |
| if form.is_valid(): | |
| form.save() | |
| redirect('reset_password') | |
| else: | |
| print(form.errors) | |
| return render(request, 'perfil/verifica_senha.html', {'unidade': unidade}) | |
| def reset_password(request): | |
| if request.method == 'POST': | |
| form = ResetPasswordFormCustom(data=request.POST, user=None) | |
| if form.is_valid(): | |
| form.save() | |
| return redirect('chamados:enviar') | |
| else: | |
| print(form.errors) | |
| return render(request, 'perfil/reset_senha.html', {'form': form}) | |
| return render(request, 'perfil/reset_senha.html', {}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment