X-Git-Url: http://git.onelab.eu/?p=myslice.git;a=blobdiff_plain;f=portal%2Fhomeview.py;h=a6656772ae9f08458d645953ea1b63a5bc93439b;hp=5b822212892597b916a91a675a7c88d219afe456;hb=3d0d7911139041e45da7fe8a3fdeaf07aa4da007;hpb=d1197c134b70bda643a752bdaf891190cb5a15e7 diff --git a/portal/homeview.py b/portal/homeview.py index 5b822212..a6656772 100644 --- a/portal/homeview.py +++ b/portal/homeview.py @@ -34,12 +34,12 @@ class HomeView (FreeAccessView): # . or None if the backend could be reached but the authentication failed auth_result = authenticate(token=token) # use one or two columns for the layout - not logged in users will see the login prompt - env['layout_1_or_2']="layout-unfold2.html" if not username else "layout-unfold1.html" # high-level errors, like connection refused or the like if isinstance (auth_result, ManifoldResult): manifoldresult = auth_result # let's use ManifoldResult.__repr__ env['state']="%s"%manifoldresult + env['layout_1_or_2']="layout-unfold2.html" return render_to_response('home-view.html',env, context_instance=RequestContext(request)) # user was authenticated at the backend elif auth_result is not None: @@ -50,10 +50,12 @@ class HomeView (FreeAccessView): return HttpResponseRedirect ('/login-ok') else: env['state'] = "Your account is not active, please contact the site admin." + env['layout_1_or_2']="layout-unfold2.html" return render_to_response('home-view.html',env, context_instance=RequestContext(request)) # otherwise else: env['state'] = "Your username and/or password were incorrect." + env['layout_1_or_2']="layout-unfold2.html" return render_to_response('home-view.html',env, context_instance=RequestContext(request)) # login-ok sets state="Welcome to MySlice" in urls.py