216e52471475

web: fix some of the username encoding issues
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Wed, 14 Jul 2010 18:01:12 -0400
parents 37378ae56a2f
children 16b417409038
branches/tags (none)
files review/templates/changeset.html review/web.py

Changes

--- a/review/templates/changeset.html	Wed Jul 14 09:23:24 2010 -0400
+++ b/review/templates/changeset.html	Wed Jul 14 18:01:12 2010 -0400
@@ -31,7 +31,7 @@
             {{ rev.rev() }}:
             <span class="desc">{{ rev.description().splitlines()[0] }}</span>
             <span class="by">by</span>
-            <a href="mailto:{{ utils['email'](rev.user()) }}">{{ utils['templatefilters'].person(rev.user()) }}</a>
+            <a href="mailto:{{ utils['email'](rev.user()) }}">{{ utils['person'](rev.user()) }}</a>
         </h2>
 
         {% if utils['len'](rev.description().splitlines()) > 1 %}
--- a/review/web.py	Wed Jul 14 09:23:24 2010 -0400
+++ b/review/web.py	Wed Jul 14 18:01:12 2010 -0400
@@ -54,12 +54,18 @@
              'no': len(filter(lambda s: s.opinion == 'no', signoffs)),
              'neutral': len(filter(lambda s: s.opinion == '', signoffs)),}
 
+def _email(s):
+    return fromlocal(email(s))
+
+def _person(s):
+    return fromlocal(templatefilters.person(s))
 
 markdowner = markdown2.Markdown(safe_mode='escape', extras=['code-friendly', 'pyshell', 'imgless'])
 utils = {
     'node_short': short,
     'md5': md5,
-    'email': email,
+    'email': _email,
+    'person': _person,
     'templatefilters': templatefilters,
     'len': len,
     'item_gravatar': _item_gravatar,