Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions perfil/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ def post(self, *args, **kwargs):

login(self.request, user=usuario)

# Redireciona para lista de produtos caso não tenha um carrinho ainda ao criar ou acessar a conta
carrinho = copy.deepcopy(self.request.session.get('carrinho'))
if not carrinho:
return redirect('produto:lista')

messages.success(
self.request,
'Você fez login no sistema e pode concluir sua compra.'
Expand Down