Add: Redirect logged in users to homepage
This commit is contained in:
parent
c4dfd547de
commit
8318750eb0
1 changed files with 4 additions and 0 deletions
|
@ -5,6 +5,10 @@ from .forms import LoginForm, SignUpForm
|
||||||
|
|
||||||
|
|
||||||
def login_view(request):
|
def login_view(request):
|
||||||
|
if request.user.is_authenticated:
|
||||||
|
# User is already logged in, redirect them to the home page
|
||||||
|
return redirect('/')
|
||||||
|
|
||||||
form = LoginForm(request.POST or None)
|
form = LoginForm(request.POST or None)
|
||||||
|
|
||||||
msg = None
|
msg = None
|
||||||
|
|
Loading…
Reference in a new issue