From f8539cc2d78dbabec005d12d9529653b1609e658 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Wed, 8 May 2013 17:10:54 -0400 Subject: [PATCH] Redirect authenticated users from registration or login to dashboard --- common/djangoapps/student/views.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/djangoapps/student/views.py b/common/djangoapps/student/views.py index c0136b0878..787283ace2 100644 --- a/common/djangoapps/student/views.py +++ b/common/djangoapps/student/views.py @@ -216,6 +216,9 @@ def signin_user(request): """ This view will display the non-modal login form """ + if request.user.is_authenticated(): + return redirect(reverse('dashboard')) + context = { 'course_id': request.GET.get('course_id'), 'enrollment_action': request.GET.get('enrollment_action') @@ -227,6 +230,9 @@ def register_user(request): """ This view will display the non-modal registration form """ + if request.user.is_authenticated(): + return redirect(reverse('dashboard')) + context = { 'course_id': request.GET.get('course_id'), 'enrollment_action': request.GET.get('enrollment_action')