From 07b06a41772cce87800a9d00007300c3e23ca7e7 Mon Sep 17 00:00:00 2001 From: SDE Date: Fri, 12 Apr 2024 18:40:06 +0300 Subject: [PATCH] 0.12.33 fix redirect to subscribe after login --- AuthApp/js_views.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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)