Skip to content

Switch ugettext to ugettext_lazy in models.py #301

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

Merged

Conversation

haikuginger
Copy link
Contributor

Fixes #288.

We have a use case where we need to import this package before the app registry is ready. This pull request changes ugettext calls in models.py to ugettext_lazy.

If we can get this in a 1.9.1 release soon, that'd be great, but if not, then we can just point at the master hash once it's merged.

@itsjeyd, can you check this code for me?

@codecov-io
Copy link

Codecov Report

Merging #301 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #301   +/-   ##
=======================================
  Coverage   97.62%   97.62%           
=======================================
  Files          15       15           
  Lines         590      590           
  Branches       72       72           
=======================================
  Hits          576      576           
  Misses          7        7           
  Partials        7        7
Impacted Files Coverage Δ
simple_history/models.py 96.85% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dac00e0...dc3b446. Read the comment docs.

@itsjeyd
Copy link

itsjeyd commented Jul 12, 2017

@haikuginger The code LGTM. I'm currently building a new devstack for testing the changes; will formally approve once I've verified the changes according to the instructions you left on the internal ticket.

Copy link

@itsjeyd itsjeyd left a comment

Choose a reason for hiding this comment

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

@haikuginger 👍

  • I tested this: Ran paver update_db with version 1.9.0 of django-simple-history installed; it failed with

    django.core.exceptions.AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.

    (as expected). Then I installed the version from this PR and ran paver update_db again. This time it did not produce an AppRegistryNotReady error.

  • I read through the code

  • I checked for accessibility issues N/A

  • Includes documentation: In the form of a changelog entry.

@macro1 macro1 merged commit b01b92c into django-commons:master Jul 15, 2017
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.

4 participants