• R/O
  • SSH
  • HTTPS

shibuya-trac: Commit


Commit MetaInfo

Revision873 (tree)
Time2015-04-29 20:47:37
Authorjun66j5

Log Message

TracAvatarPlugin: replace format_author template method only for timeline.html to avoid crashing discussion plugin

Change Summary

Incremental Difference

--- plugins/tracavatarplugin/branches/0.12/setup.py (revision 872)
+++ plugins/tracavatarplugin/branches/0.12/setup.py (revision 873)
@@ -5,7 +5,7 @@
55
66 setup(
77 name='TracAvatarPlugin',
8- version='0.3',
8+ version='0.3.1',
99 zip_safe = True,
1010 packages=find_packages(exclude=['*.tests*']),
1111
--- plugins/tracavatarplugin/branches/0.12/tracavatar/web_ui.py (revision 872)
+++ plugins/tracavatarplugin/branches/0.12/tracavatar/web_ui.py (revision 873)
@@ -16,7 +16,7 @@
1616 return handler
1717
1818 def post_process_request(self, req, template, data, content_type):
19- if data:
19+ if template and data:
2020 req.callbacks['avatars'] = self._get_avatars
2121 if template == 'ticket.html' and 'ticket' in data:
2222 ticket = data['ticket']
@@ -29,7 +29,8 @@
2929 self._avatar_image(req, ticket['reporter']),
3030 data['reporter_link'])
3131 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)
3334 add_script_data(req, {'avatar_request_path': req.href.tracavatar(),
3435 'form_token': req.form_token})
3536 add_stylesheet(req, 'tracavatar/css/avatar.css')
@@ -92,4 +93,4 @@
9293
9394 def get_htdocs_dirs(self):
9495 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'))]
Show on old repository browser