From 0172b220613d475931340f29340dc9136264038c Mon Sep 17 00:00:00 2001 From: Muhammad Faraz Maqsood Date: Fri, 5 Jul 2024 16:13:06 +0500 Subject: [PATCH] address comments --- .../sdaia_features/course_progress/api/v1/views.py | 12 ++++++++++++ .../features/sdaia_features/course_progress/apps.py | 10 +++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/openedx/features/sdaia_features/course_progress/api/v1/views.py b/openedx/features/sdaia_features/course_progress/api/v1/views.py index 6257901efdd2..be8baa7f4524 100644 --- a/openedx/features/sdaia_features/course_progress/api/v1/views.py +++ b/openedx/features/sdaia_features/course_progress/api/v1/views.py @@ -24,6 +24,18 @@ @can_disable_rate_limit class UserWatchHoursAPIView(APIView): + """ + APIView to get the total watch hours for a user. + + **Example Requests** + GET /sdaia/api/v1/user_watch_hours + + It return watch_time in hours + Response: { + "watch_time": 0.00043390860160191856 + } + """ + authentication_classes = ( JwtAuthentication, BearerAuthenticationAllowInactiveUser, diff --git a/openedx/features/sdaia_features/course_progress/apps.py b/openedx/features/sdaia_features/course_progress/apps.py index 1af0249d67ef..7f9a6ed4ee13 100644 --- a/openedx/features/sdaia_features/course_progress/apps.py +++ b/openedx/features/sdaia_features/course_progress/apps.py @@ -11,11 +11,11 @@ class CourseProgressConfig(AppConfig): name = "openedx.features.sdaia_features.course_progress" plugin_app = { - "url_config": { - "lms.djangoapp": { - "namespace": "course_progress", - "regex": r"^sdaia", - "relative_path": "urls", + PluginURLs.CONFIG: { + ProjectType.LMS: { + PluginURLs.NAMESPACE: "course_progress", + PluginURLs.REGEX: r"^sdaia", + PluginURLs.RELATIVE_PATH: "urls", } }, PluginSettings.CONFIG: {