|
|
@ -731,8 +731,8 @@ class CourseLiveSessionRecordedFileAPIView(GenericAPIView): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class CourseLiveSessionSetRecordingTitleAPIView(GenericAPIView): |
|
|
class CourseLiveSessionSetRecordingTitleAPIView(GenericAPIView): |
|
|
permission_classes = [IsAuthenticated] |
|
|
|
|
|
authentication_classes = [TokenAuthentication] |
|
|
|
|
|
|
|
|
permission_classes = [AllowAny] |
|
|
|
|
|
authentication_classes = [] |
|
|
|
|
|
|
|
|
@swagger_auto_schema( |
|
|
@swagger_auto_schema( |
|
|
operation_description="Set the recording title for the active live session", |
|
|
operation_description="Set the recording title for the active live session", |
|
|
@ -763,13 +763,8 @@ class CourseLiveSessionSetRecordingTitleAPIView(GenericAPIView): |
|
|
except CourseLiveSession.DoesNotExist: |
|
|
except CourseLiveSession.DoesNotExist: |
|
|
raise AppAPIException({'message': 'Active session not found.'}, status_code=status.HTTP_404_NOT_FOUND) |
|
|
raise AppAPIException({'message': 'Active session not found.'}, status_code=status.HTTP_404_NOT_FOUND) |
|
|
|
|
|
|
|
|
# Check if user has permission to manage course associated with session |
|
|
|
|
|
if not request.user.can_manage_course(session.course): |
|
|
|
|
|
raise AppAPIException({'message': 'Permission denied.'}, status_code=status.HTTP_403_FORBIDDEN) |
|
|
|
|
|
|
|
|
|
|
|
session.recording_title = title.strip() |
|
|
session.recording_title = title.strip() |
|
|
session.save(update_fields=['recording_title', 'updated_at']) |
|
|
session.save(update_fields=['recording_title', 'updated_at']) |
|
|
|
|
|
|
|
|
logger.info(f"[LiveSession Title] Set recording title for room_id={room_id} to '{title}'") |
|
|
logger.info(f"[LiveSession Title] Set recording title for room_id={room_id} to '{title}'") |
|
|
return Response({'success': True, 'message': 'Recording title updated successfully.'}, status=status.HTTP_200_OK) |
|
|
return Response({'success': True, 'message': 'Recording title updated successfully.'}, status=status.HTTP_200_OK) |
|
|
|
|
|
|