Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: course mode list concatenation issue #138

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ Change Log
Unreleased
**********

4.4.7 - 2024-11-25
******************
* Fixes the Course Chat View CourseMode concatenation issue

4.4.6 - 2024-11-22
******************
* Gates the chat history endpoint behind a waffle flag
* Add LearningAssistantAuditTrial model

4.4.5 - 2024-11-12
******************
Expand Down
2 changes: 1 addition & 1 deletion learning_assistant/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Plugin for a learning assistant backend, intended for use within edx-platform.
"""

__version__ = '4.4.6'
__version__ = '4.4.7'

default_app_config = 'learning_assistant.apps.LearningAssistantConfig' # pylint: disable=invalid-name
3 changes: 2 additions & 1 deletion learning_assistant/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ def post(self, request, course_run_id):
if (
# Here we include CREDIT_MODE and NO_ID_PROFESSIONAL_MODE, as CourseMode.VERIFIED_MODES on its own
# doesn't match what we count as "verified modes" in the frontend component.
enrollment_mode in CourseMode.VERIFIED_MODES + CourseMode.CREDIT_MODE + CourseMode.NO_ID_PROFESSIONAL_MODE
enrollment_mode in CourseMode.VERIFIED_MODES + CourseMode.CREDIT_MODES
+ [CourseMode.NO_ID_PROFESSIONAL_MODE]
or user_role_is_staff(user_role)
):
return self._get_next_message(request, courserun_key, course_run_id)
Expand Down
12 changes: 6 additions & 6 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ def test_audit_trial_expired(self, mock_mode, mock_enrollment,
mock_waffle.return_value = True
mock_role.return_value = 'student'
mock_mode.VERIFIED_MODES = ['verified']
mock_mode.CREDIT_MODE = ['credit']
mock_mode.NO_ID_PROFESSIONAL_MODE = ['no-id']
mock_mode.CREDIT_MODES = ['credit']
mock_mode.NO_ID_PROFESSIONAL_MODE = 'no-id'
varshamenon4 marked this conversation as resolved.
Show resolved Hide resolved
mock_mode.UPSELL_TO_VERIFIED_MODES = ['audit']
mock_mode.objects.get.return_value = MagicMock()
mock_mode.expiration_datetime.return_value = datetime.now() - timedelta(days=1)
Expand All @@ -165,8 +165,8 @@ def test_invalid_enrollment_mode(self, mock_mode, mock_enrollment, mock_role, mo
mock_waffle.return_value = True
mock_role.return_value = 'student'
mock_mode.VERIFIED_MODES = ['verified']
mock_mode.CREDIT_MODE = ['credit']
mock_mode.NO_ID_PROFESSIONAL_MODE = ['no-id']
mock_mode.CREDIT_MODES = ['credit']
mock_mode.NO_ID_PROFESSIONAL_MODE = 'no-id'
mock_mode.UPSELL_TO_VERIFIED_MODES = ['audit']
mock_mode.objects.get.return_value = MagicMock()
mock_mode.expiration_datetime.return_value = datetime.now() - timedelta(days=1)
Expand Down Expand Up @@ -206,8 +206,8 @@ def test_chat_response_default(
mock_waffle.return_value = True
mock_role.return_value = 'student'
mock_mode.VERIFIED_MODES = ['verified']
mock_mode.CREDIT_MODE = ['credit']
mock_mode.NO_ID_PROFESSIONAL_MODE = ['no-id']
mock_mode.CREDIT_MODES = ['credit']
mock_mode.NO_ID_PROFESSIONAL_MODE = 'no-id'
mock_mode.UPSELL_TO_VERIFIED_MODES = ['audit']
mock_enrollment.return_value = MagicMock(mode=enrollment_mode)
mock_chat_response.return_value = (200, {'role': 'assistant', 'content': 'Something else'})
Expand Down
Loading