From 583bcfc9a8d633ab8b8193219f887e3a7d5e3d71 Mon Sep 17 00:00:00 2001 From: SDE Date: Mon, 31 Jul 2023 18:45:41 +0300 Subject: [PATCH] 0.1.4 login required --- AuthApp/js_views.py | 6 ++++++ AuthApp/views.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/AuthApp/js_views.py b/AuthApp/js_views.py index a1c0ff0..32f9018 100644 --- a/AuthApp/js_views.py +++ b/AuthApp/js_views.py @@ -13,6 +13,7 @@ from django.template.loader import render_to_string from django.urls import reverse +@login_required(login_url='/profile/login/') def subscribe_ajax(request): if request.method != 'POST': raise Http404 @@ -23,6 +24,7 @@ def subscribe_ajax(request): html = render_to_string('blocks/profile/b_subscribe.html', Dict, request=request) return JsonResponse({'html': html}, status=200) +@login_required(login_url='/profile/login/') def new_msg_to_user_ajax(request): if request.method != 'POST': raise Http404 @@ -33,6 +35,7 @@ def new_msg_to_user_ajax(request): html = render_to_string('blocks/profile/b_new_msg_to_user.html', Dict, request=request) return JsonResponse({'html': html}, status=200) +@login_required(login_url='/profile/login/') def new_msg_to_support_ajax(request): if request.method != 'POST': raise Http404 @@ -44,6 +47,7 @@ def new_msg_to_support_ajax(request): return JsonResponse({'html': html}, status=200) +@login_required(login_url='/profile/login/') def support_create_ticket_ajax(request): from ChatServiceApp.forms import CreateTicketForm @@ -58,6 +62,7 @@ def support_create_ticket_ajax(request): return JsonResponse({'html': html}, status=200) +@login_required(login_url='/profile/login/') def change_profile_ajax(request): if request.method != 'POST': raise Http404 @@ -69,6 +74,7 @@ def change_profile_ajax(request): return JsonResponse({'html': html}, status=200) +@login_required(login_url='/profile/login/') def my_routes_ajax(request): if request.method != 'POST': raise Http404 diff --git a/AuthApp/views.py b/AuthApp/views.py index a965b91..4cc18a5 100644 --- a/AuthApp/views.py +++ b/AuthApp/views.py @@ -22,7 +22,7 @@ def registration_View(request): return HttpResponse(t.render(Dict, request)) -login_required(login_url='/login/') +@login_required(login_url='/profile/login/') def user_profile_View(request): Dict = {}