|
|
|
@ -47,6 +47,11 @@ class CourseLessonSerializer(serializers.ModelSerializer): |
|
|
|
"""Deprecated: use _has_access instead.""" |
|
|
|
return self._has_access(student, course) |
|
|
|
|
|
|
|
def _get_authenticated_user(self): |
|
|
|
"""Helper method to retrieve the authenticated user from the context.""" |
|
|
|
request = self.context.get('request') |
|
|
|
return request.user if request and request.user.is_authenticated else None |
|
|
|
|
|
|
|
def get_is_complated(self, obj): |
|
|
|
request = self.context.get('request') |
|
|
|
if not request or not request.user.is_authenticated: |
|
|
|
|