Commit 6472e0eb by Victor Shnayder

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

parent 2e34c4ae
...@@ -46,7 +46,11 @@ ...@@ -46,7 +46,11 @@
(function() { (function() {
$(document).delegate('#login_form', 'ajax:success', function(data, json, xhr) { $(document).delegate('#login_form', 'ajax:success', function(data, json, xhr) {
if(json.success) { 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 { } else {
if($('#login_error').length == 0) { if($('#login_error').length == 0) {
$('#login_form').prepend('<div id="login_error" class="modal-form-error"></div>'); $('#login_form').prepend('<div id="login_error" class="modal-form-error"></div>');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment