From 5ee2dd0eece7a7360dfb6bef217dc7eaeeaad9fc Mon Sep 17 00:00:00 2001 From: Cédric Bonhomme Date: Fri, 16 May 2014 07:42:40 +0200 Subject: Login and signup for already users only. --- pyaggr3g470r/views.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'pyaggr3g470r') diff --git a/pyaggr3g470r/views.py b/pyaggr3g470r/views.py index 8d214144..abc7a68a 100644 --- a/pyaggr3g470r/views.py +++ b/pyaggr3g470r/views.py @@ -137,6 +137,9 @@ def login(): """ Log in view. """ + if g.user is not None and g.user.is_authenticated(): + return redirect(url_for('home')) + g.user = AnonymousUserMixin() form = SigninForm() @@ -173,6 +176,9 @@ def signup(): """ Signup page. """ + if g.user is not None and g.user.is_authenticated(): + return redirect(url_for('home')) + form = SignupForm() if form.validate_on_submit(): -- cgit