From 6472e0ebe338584dd83959df0c27fd70d73159d8 Mon Sep 17 00:00:00 2001 From: Victor Shnayder Date: Fri, 14 Sep 2012 14:29:31 -0400 Subject: [PATCH] If there's a ?next param, redirect there instead of dashboard after login --- lms/templates/login_modal.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lms/templates/login_modal.html b/lms/templates/login_modal.html index d7d327178c..0b19399fc0 100644 --- a/lms/templates/login_modal.html +++ b/lms/templates/login_modal.html @@ -46,7 +46,11 @@ (function() { $(document).delegate('#login_form', 'ajax:success', function(data, json, xhr) { if(json.success) { - location.href="${reverse('dashboard')}"; + % if request.REQUEST.get('next', False): + location.href="${request.REQUEST.get('next')}"; + % else: + location.href="${reverse('dashboard')}"; + % endif } else { if($('#login_error').length == 0) { $('#login_form').prepend('');