TracAvatarPlugin: replace format_author template method only for timeline.html to avoid crashing discussion plugin
@@ -5,7 +5,7 @@ | ||
5 | 5 | |
6 | 6 | setup( |
7 | 7 | name='TracAvatarPlugin', |
8 | - version='0.3', | |
8 | + version='0.3.1', | |
9 | 9 | zip_safe = True, |
10 | 10 | packages=find_packages(exclude=['*.tests*']), |
11 | 11 |
@@ -16,7 +16,7 @@ | ||
16 | 16 | return handler |
17 | 17 | |
18 | 18 | def post_process_request(self, req, template, data, content_type): |
19 | - if data: | |
19 | + if template and data: | |
20 | 20 | req.callbacks['avatars'] = self._get_avatars |
21 | 21 | if template == 'ticket.html' and 'ticket' in data: |
22 | 22 | ticket = data['ticket'] |
@@ -29,7 +29,8 @@ | ||
29 | 29 | self._avatar_image(req, ticket['reporter']), |
30 | 30 | data['reporter_link']) |
31 | 31 | data['authorinfo'] = partial(self.authorinfo, req) |
32 | - data['format_author'] = partial(self.format_author, req) | |
32 | + if template == 'timeline.html': | |
33 | + data['format_author'] = partial(self.format_author, req) | |
33 | 34 | add_script_data(req, {'avatar_request_path': req.href.tracavatar(), |
34 | 35 | 'form_token': req.form_token}) |
35 | 36 | add_stylesheet(req, 'tracavatar/css/avatar.css') |
@@ -92,4 +93,4 @@ | ||
92 | 93 | |
93 | 94 | def get_htdocs_dirs(self): |
94 | 95 | from pkg_resources import resource_filename |
95 | - return [('tracavatar', resource_filename(__name__, 'htdocs'))] | |
\ No newline at end of file | ||
96 | + return [('tracavatar', resource_filename(__name__, 'htdocs'))] |