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 language query to fetch only based on codename #98

Merged
merged 2 commits into from
Oct 5, 2023

Conversation

benoit74
Copy link
Contributor

@benoit74 benoit74 commented Oct 4, 2023

Rationale

Probably due to an upstream change (in Babel ?), languages name and native properties are not up-to-date anymore in the DB. Code was not properly handling this situation, probably assuming these properties will never change.

Changes

  • Language objects are fetched only based on their code
  • Other language objects properties (name and native) are updated if they have changed

@benoit74 benoit74 self-assigned this Oct 4, 2023
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (942be8e) 100.00% compared to head (ea51155) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #98   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        19           
  Lines          608       616    +8     
=========================================
+ Hits           608       616    +8     
Files Coverage Δ
...end/src/backend/exporters/kiwix_public_exporter.py 100.00% <ø> (ø)
backend/src/backend/formatters/__init__.py 100.00% <ø> (ø)
backend/src/backend/formatters/kiwixlibraryxml.py 100.00% <ø> (ø)
backend/src/backend/models.py 100.00% <100.00%> (ø)
backend/src/backend/routes/books.py 100.00% <100.00%> (ø)
backend/src/backend/schemas.py 100.00% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@benoit74 benoit74 marked this pull request as ready for review October 4, 2023 20:23
@benoit74 benoit74 requested a review from rgaudin October 4, 2023 20:24
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

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

Makes sense ; thank you.
What's with the formatting changes?

@rgaudin rgaudin merged commit f41546d into main Oct 5, 2023
7 checks passed
@rgaudin rgaudin deleted the fix_language_query branch October 5, 2023 08:43
@benoit74
Copy link
Contributor Author

benoit74 commented Oct 5, 2023

Regarding formatting, looks like black has changed some convention ^^

@rgaudin
Copy link
Member

rgaudin commented Oct 5, 2023

Regarding formatting, looks like black has changed some convention ^^

But the workflow checks for black on a pinned version…

@benoit74
Copy link
Contributor Author

benoit74 commented Oct 5, 2023

My fault, looks like I did not used the local version but my system one ...

@rgaudin
Copy link
Member

rgaudin commented Oct 5, 2023

Passed the QA check anyway 👍

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