[ckan-changes] commit/ckan: zephod: [test-fix][xs]: Accessing config directly (not pylons.g) to fix test.

Bitbucket commits-noreply at bitbucket.org
Fri Oct 28 12:40:41 UTC 2011


1 new commit in ckan:


https://bitbucket.org/okfn/ckan/changeset/669d424d32dd/
changeset:   669d424d32dd
user:        zephod
date:        2011-10-28 14:40:25
summary:     [test-fix][xs]: Accessing config directly (not pylons.g) to fix test.
affected #:  1 file

diff -r 9b4d1ca4411830df6effbe0f01988b7decaa94be -r 669d424d32ddafb7a7f074d3ea8739521a8798f5 ckan/lib/helpers.py
--- a/ckan/lib/helpers.py
+++ b/ckan/lib/helpers.py
@@ -15,7 +15,6 @@
 from webhelpers import paginate
 from webhelpers.text import truncate
 import webhelpers.date as date
-from pylons import g
 from pylons.decorators.cache import beaker_cache
 from routes import url_for, redirect_to
 from alphabet_paginate import AlphaPage
@@ -197,8 +196,10 @@
     if user:
         _name = user.name if model.User.VALID_NAME.match(user.name) else user.id
         # Absolute URL of default user icon
-        _icon_url_default = g.site_url + icon_url("user")
-        _icon = gravatar(user.email_hash, 16, _icon_url_default)
+        from pylons import config 
+        _site_url = config.get('ckan.site_url', '')
+        _icon_url_default = _site_url + icon_url("user")
+        _icon = gravatar(user.email_hash, 16, _icon_url_default)+" "
         displayname = user.display_name
         if maxlength and len(user.display_name) > maxlength:
             displayname = displayname[:maxlength] + '...'

Repository URL: https://bitbucket.org/okfn/ckan/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.




More information about the ckan-changes mailing list