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