Commit d83dfd19 by Őry Máté

one: redirect / to home if logged in

parent 2a3d77a2
......@@ -20,6 +20,7 @@ urlpatterns = patterns('',
url(r'^logout/$', 'school.views.logout', name='logout', ),
url(r'^$', 'one.views.index', ),
url(r'^info/$', 'one.views.info', ),
url(r'^home/$', 'one.views.home', ),
url(r'^vm/new/(?P<template>\d+)/$', 'one.views.vm_new', ),
url(r'^ajax/vm/new/(?P<template>\d+)/$', 'one.views.vm_new_ajax', ),
......
......@@ -36,8 +36,14 @@ def _list_instances(request):
instances = instances.exclude(state='DONE')
return instances
def info(request):
return render_to_response("info.html", RequestContext(request, {}))
def index(request):
return render_to_response("index.html", RequestContext(request, {}))
if request.user.is_authenticated():
return redirect(home)
else:
return redirect(info)
@require_GET
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment