Skip to content

Commit

Permalink
User on boarding update
Browse files Browse the repository at this point in the history
  • Loading branch information
ZEZE1020 committed Jan 13, 2025
1 parent 7ee5800 commit e11aa05
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,13 @@ def user_profile(request, user_id):
return render(request, 'accounts/profile.html', context)

def login_view(request):
if request.method == 'POST':
form = AuthenticationForm(data=request.POST)
if form.is_valid():
user = form.get_user()
login(request, user)
return redirect('home')
else:
form = AuthenticationForm()
return render(request, 'login.html', {'form': form})
form = AuthenticationForm(data=request.POST or None)
if request.method == 'POST' and form.is_valid():
user = form.get_user()
login(request, user)
return redirect('home')

return render(request, 'login.html', {'form': form})


def logout_view(request):
Expand Down

0 comments on commit e11aa05

Please sign in to comment.