disqus / gargoyle

Feature switches in Django
http://engineering.disqus.com
Apache License 2.0
746 stars 112 forks source link

Lazy object returned unexpected type error #51

Closed ustun closed 11 years ago

ustun commented 11 years ago

For some reason, the line

return self.model._meta.verbose_name.title()

returns a Lazy object returned unexpected type for me.

https://github.com/disqus/gargoyle/blob/master/gargoyle/conditions.py#L318

Changing it to the following is a workaround.

return self.model._meta.verbose_name_raw.title()

Here is the output of self and self.model from the console.

ipdb> self

ipdb> self.model I am not sure if this is related to gargoyle, or my set up, but I can say that I followed the steps for gargoyle and nexus integration, that is, I only have gargoyle in my installed apps, but use nexus for autodiscovery. (I don't need from **future** import absolute_import from gargoyle.conditions import ConditionSet in that case, do I?)
ustun commented 11 years ago

This turned out to be not gargoyle related, as User._meta.verbose_name.title() was failing too.

The reason was, I had the following in my locale file, which confused Django:

msgid "user" msgstr "myuser"