After upgrading to the new version of tipfy, my messages stopped working.
I noticed that the generated html page contained the following line:
tipfy.instances.messages.addMessages([{"body": "Authentication
failed. Please try again.", "level": "error"}]);
Digging deeper I reduced the problem to something like this
#######
class BaseHandler(RequestHandler, Jinja2Mixin):
...
def render_response(self, filename, **kwargs):
...
kwargs['messages'] = json_encode('abc')
return super(BaseHandler, self).render_response(filename, **kwargs)
########
This code generates the following line in the html page:
tipfy.instances.messages.addMessages("abc");
This, of course, is not a valid JSON object, but it demonstrates the
problem. How can I revert to the original string (ie. "abc")?
Thanks,
Li
--
Using Opera's revolutionary email client: http://www.opera.com/mail/ on
Fedora 15
--
You received this message because you are subscribed to the Google Groups "tipfy" group.
To post to this group, send email to ti...@googlegroups.com.
To unsubscribe from this group, send email to tipfy+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tipfy?hl=en.
On Sun, 10 Jul 2011 22:10:21 +0300, Mauro Asprea <mauro...@gmail.com>
wrote:
> maybe is the autoescape setting of the jinja2 templates
>
> Try surrounding the message section with
> {% autoescape false %}
> {% endautoescape %}
> http://jinja.pocoo.org/docs/templates/#autoescape-overrides
>
--