Skip to content

Commit 3d3b449

Browse files
change ugettext to ugettext_lazy
As calls to the translation function are located in code paths that are executed ad module load time, ugettext_lazy should be used instead. See https://docs.djangoproject.com/en/dev/topics/i18n/translation/#lazy-translations. This fixes import issue when used with other django apps that have utilities that import installed_apps such as Haystack.
1 parent 68f1f6b commit 3d3b449

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cities_light/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from django.utils.encoding import force_unicode
55
from django.db.models import signals
66
from django.db import models
7-
from django.utils.translation import ugettext as _
7+
from django.utils.translation import ugettext_lazy as _
88

99
from south.modelsinspector import add_introspection_rules
1010

0 commit comments

Comments
 (0)