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

Making updates to handle different iso codes. #155

Merged
merged 6 commits into from
Jul 11, 2023

Conversation

THOR300
Copy link
Contributor

@THOR300 THOR300 commented Jul 10, 2023

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:

  • Bug fix
  • New feature
  • Breaking change

How Has This Been Tested?

Unit test in the PR

Reviewer Checklist

  • The PR represents a single feature (small driveby fixes are also ok)
  • The PR includes tests that are sufficient for the level of risk
  • The code is sufficiently commented, particularly in hard-to-understand areas
  • Any required documentation updates have been made
  • Any TODOs added are captured in future tickets
  • No FIXMEs remain

Copy link

@joel-wright joel-wright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This certainly adds support for 2 letter codes.

app/api/api_v1/routers/admin.py Show resolved Hide resolved
@THOR300 THOR300 requested a review from joel-wright July 11, 2023 10:13
Copy link

@joel-wright joel-wright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good :)

tests/routes/test_document_families.py Show resolved Hide resolved
@THOR300 THOR300 merged commit ac8058c into main Jul 11, 2023
@THOR300 THOR300 deleted the bugfix/handle-iso-639-1-language-codes branch July 11, 2023 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants