Skip to content

Commit

Permalink
Merge branch 'master' into rpenido/fal-4005/list-courses-using-library
Browse files Browse the repository at this point in the history
  • Loading branch information
rpenido committed Feb 17, 2025
2 parents cfbccd3 + cba02f5 commit 557257b
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 27 deletions.
1 change: 1 addition & 0 deletions lms/djangoapps/commerce/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ def upgrade_url(self, user, course_key):
return None


@pluggable_override('OVERRIDE_REFUND_ENTITLEMENT')
def refund_entitlement(course_entitlement):
"""
Attempt a refund of a course entitlement. Verify the User before calling this refund method
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/instructor/enrollment.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ def send_mail_to_student(student, param_dict, language=None):
)

render_msg = presentation.render(DjangoEmailChannel, message)
if not render_msg.body_html.count(student):
if not render_msg.body_html.count(student) and message_type == 'allowed_enroll':
log.error(
{
'message': 'Email template does not contain required email address',
Expand Down
29 changes: 17 additions & 12 deletions lms/djangoapps/instructor/views/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1683,22 +1683,27 @@ def post(self, request, course_key_string):
return Response(status=status.HTTP_204_NO_CONTENT)


@transaction.non_atomic_requests
@require_POST
@ensure_csrf_cookie
@cache_control(no_cache=True, no_store=True, must_revalidate=True)
@require_course_permission(permissions.ENROLLMENT_REPORT)
@common_exceptions_400
def get_course_survey_results(request, course_id):
@method_decorator(cache_control(no_cache=True, no_store=True, must_revalidate=True), name='dispatch')
@method_decorator(transaction.non_atomic_requests, name='dispatch')
class GetCourseSurveyResults(DeveloperErrorViewMixin, APIView):
"""
get the survey results report for the particular course.
"""
course_key = CourseKey.from_string(course_id)
report_type = _('survey')
task_api.submit_course_survey_report(request, course_key)
success_status = SUCCESS_MESSAGE_TEMPLATE.format(report_type=report_type)
permission_classes = (IsAuthenticated, permissions.InstructorPermission)
permission_name = permissions.ENROLLMENT_REPORT

return JsonResponse({"status": success_status})
@method_decorator(ensure_csrf_cookie)
@method_decorator(transaction.non_atomic_requests)
def post(self, request, course_id):
"""
method to return survey results report for the particular course.
"""
course_key = CourseKey.from_string(course_id)
report_type = _('survey')
task_api.submit_course_survey_report(request, course_key)
success_status = SUCCESS_MESSAGE_TEMPLATE.format(report_type=report_type)

return JsonResponse({"status": success_status})


@transaction.non_atomic_requests
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/instructor/views/api_urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
path('problem_grade_report', api.problem_grade_report, name='problem_grade_report'),

# Reports..
path('get_course_survey_results', api.get_course_survey_results, name='get_course_survey_results'),
path('get_course_survey_results', api.GetCourseSurveyResults.as_view(), name='get_course_survey_results'),
path('export_ora2_data', api.export_ora2_data, name='export_ora2_data'),
path('export_ora2_summary', api.export_ora2_summary, name='export_ora2_summary'),

Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/support/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from edx_proctoring.runtime import set_runtime_service
from edx_proctoring.statuses import ProctoredExamStudentAttemptStatus
from edx_proctoring.tests.test_services import MockLearningSequencesService, MockScheduleItemData
from edx_proctoring.tests.utils import ProctoredExamTestCase
from edx_proctoring.tests.test_utils.utils import ProctoredExamTestCase
from oauth2_provider.models import AccessToken, RefreshToken
from opaque_keys.edx.locator import BlockUsageLocator
from organizations.tests.factories import OrganizationFactory
Expand Down
6 changes: 3 additions & 3 deletions requirements/edx/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ edx-opaque-keys[django]==2.11.0
# ora2
edx-organizations==6.13.0
# via -r requirements/edx/kernel.in
edx-proctoring==5.0.1
edx-proctoring==5.1.2
# via
# -r requirements/edx/kernel.in
# edx-proctoring-proctortrack
Expand Down Expand Up @@ -1270,9 +1270,9 @@ xblock[django]==5.1.2
# xblocks-contrib
xblock-drag-and-drop-v2==4.0.3
# via -r requirements/edx/bundled.in
xblock-google-drive==0.7.0
xblock-google-drive==0.7.1
# via -r requirements/edx/bundled.in
xblock-poll==1.14.0
xblock-poll==1.14.1
# via -r requirements/edx/bundled.in
xblock-utils==4.0.0
# via
Expand Down
6 changes: 3 additions & 3 deletions requirements/edx/development.txt
Original file line number Diff line number Diff line change
Expand Up @@ -795,7 +795,7 @@ edx-organizations==6.13.0
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
edx-proctoring==5.0.1
edx-proctoring==5.1.2
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
Expand Down Expand Up @@ -2260,11 +2260,11 @@ xblock-drag-and-drop-v2==4.0.3
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
xblock-google-drive==0.7.0
xblock-google-drive==0.7.1
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
xblock-poll==1.14.0
xblock-poll==1.14.1
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
Expand Down
6 changes: 3 additions & 3 deletions requirements/edx/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ edx-opaque-keys[django]==2.11.0
# ora2
edx-organizations==6.13.0
# via -r requirements/edx/base.txt
edx-proctoring==5.0.1
edx-proctoring==5.1.2
# via
# -r requirements/edx/base.txt
# edx-proctoring-proctortrack
Expand Down Expand Up @@ -1591,9 +1591,9 @@ xblock[django]==5.1.2
# xblocks-contrib
xblock-drag-and-drop-v2==4.0.3
# via -r requirements/edx/base.txt
xblock-google-drive==0.7.0
xblock-google-drive==0.7.1
# via -r requirements/edx/base.txt
xblock-poll==1.14.0
xblock-poll==1.14.1
# via -r requirements/edx/base.txt
xblock-utils==4.0.0
# via
Expand Down
6 changes: 3 additions & 3 deletions requirements/edx/testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ edx-opaque-keys[django]==2.11.0
# ora2
edx-organizations==6.13.0
# via -r requirements/edx/base.txt
edx-proctoring==5.0.1
edx-proctoring==5.1.2
# via
# -r requirements/edx/base.txt
# edx-proctoring-proctortrack
Expand Down Expand Up @@ -1681,9 +1681,9 @@ xblock[django]==5.1.2
# xblocks-contrib
xblock-drag-and-drop-v2==4.0.3
# via -r requirements/edx/base.txt
xblock-google-drive==0.7.0
xblock-google-drive==0.7.1
# via -r requirements/edx/base.txt
xblock-poll==1.14.0
xblock-poll==1.14.1
# via -r requirements/edx/base.txt
xblock-utils==4.0.0
# via
Expand Down

0 comments on commit 557257b

Please sign in to comment.