diff --git a/homepage/jinja2/homepage/index.html b/homepage/jinja2/homepage/index.html index a68b941..e49bbd8 100644 --- a/homepage/jinja2/homepage/index.html +++ b/homepage/jinja2/homepage/index.html @@ -3,8 +3,11 @@ {% block content %}

Quests 'n Shiet

Unga Bunga Quest
+ {% if request.user.is_authenticated %} Create New Quest
+ Logout
+ {% else %} Sign up
Login
- Logout
+ {% endif %} {% endblock %} diff --git a/login/views.py b/login/views.py index 289a15a..f273940 100644 --- a/login/views.py +++ b/login/views.py @@ -12,6 +12,8 @@ def index(request): """ The login page. """ + if request.user.is_authenticated: + return redirect('homepage:index') if request.method == "GET": form = LoginForm() return render(request, 'login/index.html', {'form': form}) diff --git a/signup/views.py b/signup/views.py index 702e800..a714690 100644 --- a/signup/views.py +++ b/signup/views.py @@ -2,12 +2,17 @@ """ /signup app views. """ -from django.shortcuts import render +from django.shortcuts import redirect, render + +from users.models import User def index(request): """ The signup page. """ + if request.user.is_authenticated: + return redirect('homepage:index') if request.method == "GET": context = {} return render(request, 'signup/index.html', context) +