def get_gravatar_hash(self): primary_email = self.get_primary_email() if primary_email: from htk.lib.gravatar.utils import get_gravatar_hash gravatar_hash = get_gravatar_hash(primary_email) else: gravatar_hash = '' return gravatar_hash
def format_suggest_username_name(user): from htk.lib.gravatar.utils import get_gravatar_hash obj = { 'username' : user.username if user.profile.has_username_set else '', 'first_name' : user.first_name.strip(), 'last_name' : user.last_name.strip(), 'display_name' : user.profile.get_display_name(), 'gravatar_hash' : get_gravatar_hash(user.email), } return obj
def gravatar_for_email(email, size=80): """ https://en.gravatar.com/site/implement/images/ """ url = '%savatar/%s?' % ( GRAVATAR_URL_PREFIX, get_gravatar_hash(email), ) url += urllib.urlencode({ 's': str(size), 'default': GRAVATAR_DEFAULT_IMAGE, }) url = escape(url) return url
def gravatar_for_email(email, size=80): """ https://en.gravatar.com/site/implement/images/ """ url = '%savatar/%s?' % ( GRAVATAR_URL_PREFIX, get_gravatar_hash(email), ) url += urllib.urlencode( { 's': str(size), 'default': GRAVATAR_DEFAULT_IMAGE, } ) url = escape(url) return url