diff --git a/AuthApp/js_views.py b/AuthApp/js_views.py index 1dd542c..dab5410 100644 --- a/AuthApp/js_views.py +++ b/AuthApp/js_views.py @@ -443,9 +443,12 @@ def login_ajax(request): html = render_to_string('forms/f_login.html', Dict, request=request) return JsonResponse({'html': html}, status=400) - + if not 'HTTP_REFERER' in request.META or not '/?next=/' in request.META['HTTP_REFERER']: + redirect_url = reverse('profile_page', args=['dashboard']) + else: + redirect_url = request.META['HTTP_REFERER'].split('/?next=')[1] res_Dict = { - 'redirect_url': reverse('profile_page', args=['dashboard']) + 'redirect_url': redirect_url } return JsonResponse(res_Dict)