Skip to content

Commit

Permalink
Merge branch 'master' into navin/fal-4006/course-libraries-page
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChV authored Feb 18, 2025
2 parents 1e74ac3 + 5077910 commit eb313d2
Show file tree
Hide file tree
Showing 12 changed files with 60 additions and 49 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
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@
<tr>
<p style="color: rgba(0,0,0,.75); font-size: 16px; font-size: 1rem; margin: 0; padding-top: 20px; padding-bottom: 14px">
{% filter force_escape %}
{% blocktrans count count=days_per_week asvar goal_text %}
You set a goal of learning {start_bold}{{days_per_week}} time a week in {{course_name}}{end_bold}. You’re not quite there, but there's still time to reach that goal!
{% plural %}
You set a goal of learning {start_bold}{{days_per_week}} times a week in {{course_name}}{end_bold}. You're not quite there, but there's still time to reach that goal!
{% endblocktrans %}
{% autoescape off %}
{% blocktrans count count=days_per_week asvar goal_text %}
You set a goal of learning {start_bold}{{days_per_week}} time a week in {{course_name}}{end_bold}. You’re not quite there, but there's still time to reach that goal!
{% plural %}
You set a goal of learning {start_bold}{{days_per_week}} times a week in {{course_name}}{end_bold}. You're not quite there, but there's still time to reach that goal!
{% endblocktrans %}
{% endautoescape %}
{% endfilter %}
{% interpolate_html goal_text start_bold='<b>'|safe end_bold='</b>'|safe %}
</p>
Expand Down Expand Up @@ -107,7 +109,7 @@
{% filter force_escape %}{% blocktrans %}
Adjust my goal
{% endblocktrans %}{% endfilter %}
</div>
</div>
</a>

<center>
Expand All @@ -134,4 +136,4 @@
</td>
</tr>
</table>
{% endblock %}
{% endblock %}
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{% load i18n %}
{% trans "You're almost there!" %}
{% trans "There's still time to reach your goal" as tmsg %}
{% autoescape off %}
{% blocktrans %}You set a goal of learning {{days_per_week}} times a week in {{course_name}}. You're not quite there, but there's still time to reach that goal!{% endblocktrans %}
{% endautoescape %}
{% trans "Jump back in"}
{{course_url}}
{% blocktrans %}Remember, you can always change your learning goal. The best goal is one that you can stick to. {% endblocktrans %}
{% trans "Adjust my goal"}
{{course_url}}
{% trans "Unsubscribe from goal reminder emails to this course"}
{{course_url}}
{{course_url}}
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
11 changes: 7 additions & 4 deletions openedx/core/djangoapps/notifications/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,13 @@ def notification_preference_unsubscribe_event(user):
"""
Emits an event when user clicks on one-click-unsubscribe url
"""
event_data = {
context_data = {
'user_id': user.id,
'username': user.username,
'event_type': 'email_digest_unsubscribe'
'username': user.username
}
tracker.emit(NOTIFICATION_PREFERENCE_UNSUBSCRIBE, event_data)
event_data = context_data.copy()
event_data['event_type'] = 'email_digest_unsubscribe'

with tracker.get_tracker().context(NOTIFICATION_PREFERENCE_UNSUBSCRIBE, context_data):
tracker.emit(NOTIFICATION_PREFERENCE_UNSUBSCRIBE, event_data)
segment.track(user.id, NOTIFICATION_PREFERENCE_UNSUBSCRIBE, event_data)
8 changes: 4 additions & 4 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 @@ -582,7 +582,7 @@ fs-s3fs==0.1.8
# openedx-django-pyfs
future==1.0.0
# via pyjwkest
geoip2==4.8.1
geoip2==5.0.1
# via -r requirements/edx/kernel.in
glob2==0.7
# via -r requirements/edx/kernel.in
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
13 changes: 6 additions & 7 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 @@ -883,7 +883,7 @@ execnet==2.1.1
# pytest-xdist
factory-boy==3.3.1
# via -r requirements/edx/testing.txt
faker==35.0.0
faker==36.1.1
# via
# -r requirements/edx/testing.txt
# factory-boy
Expand Down Expand Up @@ -933,7 +933,7 @@ future==1.0.0
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
# pyjwkest
geoip2==4.8.1
geoip2==5.0.1
# via
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
Expand Down Expand Up @@ -1729,7 +1729,6 @@ python-dateutil==2.9.0.post0
# edx-ace
# edx-enterprise
# edx-proctoring
# faker
# freezegun
# icalendar
# olxcleaner
Expand Down Expand Up @@ -2122,7 +2121,6 @@ typing-extensions==4.12.2
# django-stubs-ext
# djangorestframework-stubs
# edx-opaque-keys
# faker
# fastapi
# grimp
# import-linter
Expand All @@ -2139,6 +2137,7 @@ tzdata==2025.1
# -r requirements/edx/doc.txt
# -r requirements/edx/testing.txt
# celery
# faker
# icalendar
# kombu
unicodecsv==0.14.1
Expand Down Expand Up @@ -2260,11 +2259,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
8 changes: 4 additions & 4 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 @@ -683,7 +683,7 @@ future==1.0.0
# via
# -r requirements/edx/base.txt
# pyjwkest
geoip2==4.8.1
geoip2==5.0.1
# via -r requirements/edx/base.txt
gitdb==4.0.12
# via gitpython
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
13 changes: 6 additions & 7 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 @@ -680,7 +680,7 @@ execnet==2.1.1
# via pytest-xdist
factory-boy==3.3.1
# via -r requirements/edx/testing.in
faker==35.0.0
faker==36.1.1
# via factory-boy
fastapi==0.115.7
# via pact-python
Expand Down Expand Up @@ -719,7 +719,7 @@ future==1.0.0
# via
# -r requirements/edx/base.txt
# pyjwkest
geoip2==4.8.1
geoip2==5.0.1
# via -r requirements/edx/base.txt
glob2==0.7
# via -r requirements/edx/base.txt
Expand Down Expand Up @@ -1319,7 +1319,6 @@ python-dateutil==2.9.0.post0
# edx-ace
# edx-enterprise
# edx-proctoring
# faker
# freezegun
# icalendar
# olxcleaner
Expand Down Expand Up @@ -1577,7 +1576,6 @@ typing-extensions==4.12.2
# anyio
# django-countries
# edx-opaque-keys
# faker
# fastapi
# grimp
# import-linter
Expand All @@ -1591,6 +1589,7 @@ tzdata==2025.1
# via
# -r requirements/edx/base.txt
# celery
# faker
# icalendar
# kombu
unicodecsv==0.14.1
Expand Down Expand Up @@ -1681,9 +1680,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 eb313d2

Please sign in to comment.