|
|
|
|
@ -7,6 +7,7 @@ from django.http import JsonResponse, Http404 |
|
|
|
|
from django.shortcuts import get_object_or_404 |
|
|
|
|
from django.template import loader, Context, Template |
|
|
|
|
from django.views.generic import View, CreateView, DetailView, ListView, TemplateView |
|
|
|
|
from django.utils.cache import add_never_cache_headers |
|
|
|
|
from django.utils.decorators import method_decorator |
|
|
|
|
from django.views.decorators.csrf import csrf_exempt |
|
|
|
|
from django.views.decorators.http import require_http_methods |
|
|
|
|
@ -245,12 +246,14 @@ class CoursesView(ListView): |
|
|
|
|
else: |
|
|
|
|
prev_url = None |
|
|
|
|
next_url = None |
|
|
|
|
return JsonResponse({ |
|
|
|
|
response = JsonResponse({ |
|
|
|
|
'success': True, |
|
|
|
|
'content': html, |
|
|
|
|
'prev_url': prev_url, |
|
|
|
|
'next_url': next_url, |
|
|
|
|
}) |
|
|
|
|
add_never_cache_headers(response) |
|
|
|
|
return response |
|
|
|
|
else: |
|
|
|
|
return super().get(request, args, kwargs) |
|
|
|
|
|
|
|
|
|
|