dashboard page
This commit is contained in:
SDE
2023-11-10 18:06:05 +03:00
parent d4e3b75bcb
commit 0c20d7d0f4
8 changed files with 43 additions and 9 deletions

View File

@@ -152,6 +152,25 @@ def change_profile_confirm_ajax(request):
html = get_profile_change_page_content_html(request)
return JsonResponse({'html': html}, status=200)
@login_required(login_url='/profile/login/')
def dashboard_ajax(request):
if request.method != 'POST':
raise Http404
try:
from .funcs import get_dashboard_page_content_html
html = get_dashboard_page_content_html(request)
except Exception as e:
msg = f'dashboard_ajax Error = {str(e)}'
print(msg)
html = msg
return JsonResponse({'html': html}, status=200)
@login_required(login_url='/profile/login/')
def change_profile_ajax(request):
if request.method != 'POST':
@@ -208,7 +227,7 @@ def login_ajax(request):
res_Dict = {
'redirect_url': reverse('user_profile')
'redirect_url': reverse('profile_page', args=['dashboard'])
}
return JsonResponse(res_Dict)
@@ -259,7 +278,7 @@ def registration_ajax(request):
user.user_profile.save()
res_Dict = {
'redirect_url': reverse('user_profile')
'redirect_url': reverse('profile_page', args=['dashboard'])
}
return JsonResponse(res_Dict)