Making updates to handle different iso codes. #155
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The current backend code assumes that language codes send to the update document endpoint will be if the for iso-639-3. This is a three letter representation of the language.
The pipeline identifies languages as iso-639-1 which is a two letter representation.
Thus, the endpoint is updated to handle the differing language codes. A unit test is also added to check functionality.
NOTE:
Should we update the languages table to enforce part1_codes being unique and len(2) as the functionality will rely on that an in practice the two letter codes should be unique and two letters (the same of language codes and three letters)?
Should we also at least log when we pass over a language update due to it not existing in the database?
Linear Ticket
Type of change
Please select the option(s) below that are most relevant:
How Has This Been Tested?
Unit test in the PR
Reviewer Checklist