If there's a ?next param, redirect there instead of dashboard after login

This commit is contained in:
Victor Shnayder
2012-09-14 14:29:31 -04:00
parent 2e34c4ae5c
commit 6472e0ebe3

View File

@@ -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('<div id="login_error" class="modal-form-error"></div>');