|
|
|
|
@ -185,7 +185,7 @@ class CourseView(DetailView): |
|
|
|
|
def get(self, request, *args, **kwargs): |
|
|
|
|
response = super().get(request, *args, **kwargs) |
|
|
|
|
context = self.get_context_data() |
|
|
|
|
if (not request.user.is_authenticated and self.object.status != Course.PUBLISHED) or\ |
|
|
|
|
if not request.user.is_authenticated or (not request.user.is_authenticated and self.object.status != Course.PUBLISHED) or\ |
|
|
|
|
(request.user.is_authenticated and request.user.role not in [User.AUTHOR_ROLE, User.ADMIN_ROLE] and self.object.author != request.user and self.only_lessons and not context['paid']): |
|
|
|
|
raise Http404 |
|
|
|
|
return response |
|
|
|
|
|