Skip to content

Commit

Permalink
fix: pagina de alteracao de senha com versao estavel
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrobarbosaocb committed Feb 9, 2024
1 parent 9c06c1d commit 904bcf0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
26 changes: 18 additions & 8 deletions project/app/templates/user_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ <h5 class="modal-title" id="changePasswordModalLabel">Alterar Senha</h5>
</div>
<div class="modal-body">
<!-- Your password change form goes here -->
<form id="change-password-form" method="POST" action="post">
<form id="change-password-form" method="POST" action="POST">
{% csrf_token %}
<div class="mb-3">
<!-- <div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Senha Atual</label>
<input class="form-control" type="password" name="old_password" placeholder="Senha Atual" required>
</div>
Expand All @@ -72,12 +72,22 @@ <h5 class="modal-title" id="changePasswordModalLabel">Alterar Senha</h5>
<label for="exampleInputEmail1" class="form-label">Confirmar Nova Senha</label>
<input class="form-control" type="password" name="new_password2" placeholder="Confirmar Nova Senha" required>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Fechar</button>
<button type="button" class="btn btn-primary" id="change-password-submit">Salvar Mudanças</button>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Fechar</button>
<button type="submit" class="btn btn-primary" id="change-password-submit">Salvar Mudanças</button>
</div> -->

<div class="mb-3">
<label for="exampleInputEmail1" class="form-label">Enviaremos um email para a configuração da nova senha</label>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>
<button type="submit" class="btn btn-primary" id="change-password-submit" disabled>Quero uma Nova Senha</button>
</div>

</form>
</div>
</div>
</div>
Expand Down
13 changes: 8 additions & 5 deletions project/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,15 @@ class HomeView(TemplateView):

@login_required(login_url="/login/")
def user_profile(request):
cpf = Employee.objects.get(user=request.user).cpf
maskered_cpf = f"{cpf[0:3]}.{cpf[3:6]}.{cpf[6:9]}-{cpf[9:11]}"
if request.method == 'POST':
print("trocar senha")
else:
cpf = Employee.objects.get(user=request.user).cpf
maskered_cpf = f"{cpf[0:3]}.{cpf[3:6]}.{cpf[6:9]}-{cpf[9:11]}"

return render(request,'user_profile.html',{
"cpf":maskered_cpf,
})
return render(request,'user_profile.html',{
"cpf":maskered_cpf,
})

def login(request):
if request.method =="GET":
Expand Down

0 comments on commit 904bcf0

Please sign in to comment.