|
|
|
|
@ -48,7 +48,7 @@ class CourseBuyView(TemplateView): |
|
|
|
|
|
|
|
|
|
def get(self, request, pk=None, *args, **kwargs): |
|
|
|
|
host = urlsplit(self.request.META.get('HTTP_REFERER')) |
|
|
|
|
host = host[0] + '://' + host[1] |
|
|
|
|
host = str(host[0]) + '://' + str(host[1]) |
|
|
|
|
course = Course.objects.get(id=pk) |
|
|
|
|
if request.user == course.author: |
|
|
|
|
messages.error(request, 'Вы не можете приобрести свой курс.') |
|
|
|
|
@ -85,7 +85,7 @@ class SchoolBuyView(TemplateView): |
|
|
|
|
|
|
|
|
|
def get(self, request, *args, **kwargs): |
|
|
|
|
host = urlsplit(self.request.META.get('HTTP_REFERER')) |
|
|
|
|
host = host[0] + '://' + host[1] |
|
|
|
|
host = str(host[0]) + '://' + str(host[1]) |
|
|
|
|
weekdays = set(request.GET.getlist('weekdays', [])) |
|
|
|
|
if not weekdays: |
|
|
|
|
messages.error(request, 'Выберите несколько дней недели.') |
|
|
|
|
|