redirect to supporter page if logged in

pull/1/head
Ed Summers 2011-09-27 09:27:15 +00:00
parent b709cf3d61
commit 195f6db360
1 changed files with 7 additions and 0 deletions

View File

@ -1,9 +1,16 @@
from django.template import RequestContext
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response, get_object_or_404
from regluit.core import models
def home(request):
# if the user is logged in send them to their supporter page
if request.user.is_authenticated():
return HttpResponseRedirect(reverse('supporter',
args=[request.user.username]))
return render_to_response('home.html',
{},
context_instance=RequestContext(request)