Mercurial > hg > bitsyblog
comparison bitsyblog/bitsyblog.py @ 79:4df927b0d847
fix unicode error in titles (i hope)
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Sat, 23 Oct 2010 16:54:36 -0700 |
parents | c690198a2625 |
children | 51b49bc484ff |
comparison
equal
deleted
inserted
replaced
78:5b1259424c51 | 79:4df927b0d847 |
---|---|
640 data['blog'] = blog | 640 data['blog'] = blog |
641 data['n_links'] = n_links | 641 data['n_links'] = n_links |
642 | 642 |
643 # render the template | 643 # render the template |
644 template = self.loader.load('blog.html') | 644 template = self.loader.load('blog.html') |
645 return template.generate(**data).render() | 645 try: |
646 | 646 return template.generate(**data).render() |
647 except UnicodeDecodeError: | |
648 # TODO: better error handling | |
649 raise | |
650 | |
647 def text_blog(self, blog): | 651 def text_blog(self, blog): |
648 | 652 |
649 if len(blog) == 1: | 653 if len(blog) == 1: |
650 return blog[0].body.strip() + '\n' | 654 return blog[0].body.strip() + '\n' |
651 | 655 |