Skip to content

Loading…

Use 'ugettext' instead of 'ugettext_lazy' in 'cmsplugin_contact.nospam.widgets.HoneypotWidget.render()' #40

Merged
merged 1 commit into from

2 participants

@xdml

When rendering HoneypotWidget language is already active and it is not necessary to use ugettext_lazy as it returns object instance. Plus, string operator % will insert into string value of repr() instead translated text. It results in incorrect HTML.

@xdml xdml Use 'ugettext' instead of 'ugettext_lazy' in 'cmsplugin_contact.nospa…
…m.widgets.HoneypotWidget.render()'

When rendering 'HoneypotWidget' language is already active and it is not necessary to use 'ugettext_lazy' as it returns object instance. Plus, string operator '%' will insert into string value of 'repr()' instead translated text. It results in incorrect HTML.
524044a
@maccesch maccesch merged commit 536e3af into maccesch:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 18, 2013
  1. @xdml

    Use 'ugettext' instead of 'ugettext_lazy' in 'cmsplugin_contact.nospa…

    xdml committed
    …m.widgets.HoneypotWidget.render()'
    
    When rendering 'HoneypotWidget' language is already active and it is not necessary to use 'ugettext_lazy' as it returns object instance. Plus, string operator '%' will insert into string value of 'repr()' instead translated text. It results in incorrect HTML.
Showing with 1 addition and 1 deletion.
  1. +1 −1 cmsplugin_contact/nospam/widgets.py
View
2 cmsplugin_contact/nospam/widgets.py
@@ -1,5 +1,5 @@
from django import forms
-from django.utils.translation import ugettext_lazy as _, get_language
+from django.utils.translation import ugettext as _, get_language
from django.utils.safestring import mark_safe
Something went wrong with that request. Please try again.