##// END OF EJS Templates
ui: fixed default gravatar b64 code
super-admin -
r5108:2c6a98a4 default
parent child Browse files
Show More
@@ -81,7 +81,7 b' from rhodecode.lib.html_filters import s'
81 from rhodecode.lib.pagination import Page, RepoPage, SqlPage
81 from rhodecode.lib.pagination import Page, RepoPage, SqlPage
82 from rhodecode.lib import ext_json
82 from rhodecode.lib import ext_json
83 from rhodecode.lib.ext_json import json
83 from rhodecode.lib.ext_json import json
84 from rhodecode.lib.str_utils import safe_bytes, convert_special_chars
84 from rhodecode.lib.str_utils import safe_bytes, convert_special_chars, base64_to_str
85 from rhodecode.lib.utils import repo_name_slug, get_custom_lexer
85 from rhodecode.lib.utils import repo_name_slug, get_custom_lexer
86 from rhodecode.lib.str_utils import safe_str
86 from rhodecode.lib.str_utils import safe_str
87 from rhodecode.lib.utils2 import (
87 from rhodecode.lib.utils2 import (
@@ -1304,7 +1304,7 b' class InitialsGravatar(object):'
1304 viewBox="-15 -10 439.165 429.164"
1304 viewBox="-15 -10 439.165 429.164"
1305
1305
1306 xml:space="preserve"
1306 xml:space="preserve"
1307 font-family="{font_family}
1307 font-family="{font_family}"
1308 style="background:{background};" >
1308 style="background:{background};" >
1309
1309
1310 <path d="M204.583,216.671c50.664,0,91.74-48.075,
1310 <path d="M204.583,216.671c50.664,0,91.74-48.075,
@@ -1374,8 +1374,8 b' class InitialsGravatar(object):'
1374 return img_data
1374 return img_data
1375
1375
1376 def generate_svg(self, svg_type=None):
1376 def generate_svg(self, svg_type=None):
1377 img_data = safe_bytes(self.get_img_data(svg_type))
1377 img_data = base64_to_str(self.get_img_data(svg_type))
1378 return "data:image/svg+xml;base64,%s" % safe_str(base64.b64encode(img_data))
1378 return "data:image/svg+xml;base64,{}".format(img_data)
1379
1379
1380
1380
1381 def initials_gravatar(request, email_address, first_name, last_name, size=30, store_on_disk=False):
1381 def initials_gravatar(request, email_address, first_name, last_name, size=30, store_on_disk=False):
General Comments 0
You need to be logged in to leave comments. Login now