Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@itepifanio
Copy link

No description provided.

Copy link
Owner

@turicas turicas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Obrigado pelas contribuições, Ítalo! Adicionei alguns comentários sobre mudanças.

path('troca-senha/atualizada/', views_config['password_reset_complete'], name='password_reset_complete'),
path('logout/', views_config['logout'], name='logout'),
path('entrar/', CreateUserView.as_view(), name='sign_up'),
path('editar-perfil/<int:user_id>', ProfileUpdate.as_view(), name='profile_update_form')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Como o usuário estará logado, não necessitamos passar seu id pela URL pois podemos pegá-lo diretamente por request.user.id (exemplo, para atualizar seu perfil no GitHub, a URL é a mesma para todos usuários: https://github.com/settings/profile).

return redirect(url)


class ProfileUpdate(UpdateView):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Como para acessar essa página o usuário precisa estar logado, precisamos adicionar aqui o decorator login_required - veja exemplo na documentação do Django.

@itepifanio
Copy link
Author

Removi a pk da url, adicionei o login_required pra editar o perfil do usuário e resolvi o conflito com a branch develop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants