-
Notifications
You must be signed in to change notification settings - Fork 173
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
feat: code changes for ai_languages field #4586
base: anawaz/prod-4306-1
Are you sure you want to change the base?
Conversation
@@ -1262,3 +1263,42 @@ def get_course_run_statuses(statuses, course_runs): | |||
else: | |||
statuses.add(course_run.status) | |||
return statuses | |||
|
|||
AI_LANG_SCHEMA = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too sure about this change. I like it, as it ensures that we don't put any ugly stuff accidentally in our field. I am a little concerned about having the validation on every save though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should only do the validation in the command, and not on every save?
@@ -3531,6 +3532,8 @@ def clean(self): | |||
self.enrollment_count = 0 | |||
if self.recent_enrollment_count is None: | |||
self.recent_enrollment_count = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't comment on unchanged code. Can I safely remove the translation_languages
field from the model here (but not commit the migration)? I think yes, but would love to know if I am wrong.
# Remove any keys other than `code` and `label` | ||
available_translation_languages = [{'code': lang['code'], 'label': lang['label']} for lang in available_translation_languages] | ||
|
||
# Add the labels for the codes. Currently we set the code as the label. We will be fixing this in a follow-up PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now I am setting the code as the label for transcription_languages
. We definitely need to improve this. I intend to leave it as is for now, and handle this in another ticket
PROD-4306
This is a continuation of 4585
This PR adds the relevant code changes for shifting from the
translation_languages
field to theai_languages
field. Since we do not care about preserving/copying existing data in thetranslation_languages
field, I have chosen to direct all reads/writes only to the new fieldai_languages