aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/lib/helpers.py
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2012-09-19 22:38:12 +0200
committerMarcin Kuzminski <marcin@python-works.com>2012-09-19 22:38:12 +0200
commitda6387857af936cc8fb139a622aea69083234b7e (patch)
tree408139208c25ae95bd1eded31b21bc0de52bf9c0 /rhodecode/lib/helpers.py
parentd21547c40acf57167bc1802b4aa06f376247c42b (diff)
parenta5c3e3ec3d1a05dbb94a6162ae4592d99159a7e7 (diff)
Merge branch beta into stablev1.4.2
Diffstat (limited to 'rhodecode/lib/helpers.py')
-rw-r--r--rhodecode/lib/helpers.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py
index f0db7238..699f6978 100644
--- a/rhodecode/lib/helpers.py
+++ b/rhodecode/lib/helpers.py
@@ -10,6 +10,7 @@ import urllib
import math
import logging
import re
+import urlparse
from datetime import datetime
from pygments.formatters.html import HtmlFormatter
@@ -711,11 +712,15 @@ HasRepoPermissionAny, HasRepoPermissionAll
#==============================================================================
def gravatar_url(email_address, size=30):
+ from pylons import url ## doh, we need to re-import url to mock it later
if(str2bool(config['app_conf'].get('use_gravatar')) and
config['app_conf'].get('alternative_gravatar_url')):
tmpl = config['app_conf'].get('alternative_gravatar_url', '')
+ parsed_url = urlparse.urlparse(url.current(qualified=True))
tmpl = tmpl.replace('{email}', email_address)\
- .replace('{md5email}', hashlib.md5(email_address.lower()).hexdigest())\
+ .replace('{md5email}', hashlib.md5(email_address.lower()).hexdigest()) \
+ .replace('{netloc}', parsed_url.netloc)\
+ .replace('{scheme}', parsed_url.scheme)\
.replace('{size}', str(size))
return tmpl