Commit d83dfd19 by Őry Máté

one: redirect / to home if logged in

parent 2a3d77a2
...@@ -20,6 +20,7 @@ urlpatterns = patterns('', ...@@ -20,6 +20,7 @@ urlpatterns = patterns('',
url(r'^logout/$', 'school.views.logout', name='logout', ), url(r'^logout/$', 'school.views.logout', name='logout', ),
url(r'^$', 'one.views.index', ), url(r'^$', 'one.views.index', ),
url(r'^info/$', 'one.views.info', ),
url(r'^home/$', 'one.views.home', ), url(r'^home/$', 'one.views.home', ),
url(r'^vm/new/(?P<template>\d+)/$', 'one.views.vm_new', ), url(r'^vm/new/(?P<template>\d+)/$', 'one.views.vm_new', ),
url(r'^ajax/vm/new/(?P<template>\d+)/$', 'one.views.vm_new_ajax', ), url(r'^ajax/vm/new/(?P<template>\d+)/$', 'one.views.vm_new_ajax', ),
......
...@@ -36,8 +36,14 @@ def _list_instances(request): ...@@ -36,8 +36,14 @@ def _list_instances(request):
instances = instances.exclude(state='DONE') instances = instances.exclude(state='DONE')
return instances return instances
def info(request):
return render_to_response("info.html", RequestContext(request, {}))
def index(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 @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