##// END OF EJS Templates
initial-gravatars: fix case of dot beeing present before @domain.
dan -
r2062:623ff10e default
parent child Browse files
Show More
@@ -1151,7 +1151,7 b' class InitialsGravatar(object):'
1151
1151
1152 # check if prefix is maybe a 'first_name.last_name' syntax
1152 # check if prefix is maybe a 'first_name.last_name' syntax
1153 _dot_split = prefix.rsplit('.', 1)
1153 _dot_split = prefix.rsplit('.', 1)
1154 if len(_dot_split) == 2:
1154 if len(_dot_split) == 2 and _dot_split[1]:
1155 initials = [_dot_split[0][0], _dot_split[1][0]]
1155 initials = [_dot_split[0][0], _dot_split[1][0]]
1156 else:
1156 else:
1157 initials = [prefix[0], server[0]]
1157 initials = [prefix[0], server[0]]
@@ -281,6 +281,7 b' def test_gravatar_url_builder(tmpl_url, '
281 ('admin@', 'Marcin', 'Śuzminski', 'MS', '#aa00ff'),
281 ('admin@', 'Marcin', 'Śuzminski', 'MS', '#aa00ff'),
282 ('marcin.śuzminski', '', '', 'MS', '#402020'),
282 ('marcin.śuzminski', '', '', 'MS', '#402020'),
283 ('null', '', '', 'NL', '#8c4646'),
283 ('null', '', '', 'NL', '#8c4646'),
284 ('some.@abc.com', 'some', '', 'SA', '#664e33')
284 ])
285 ])
285 def test_initials_gravatar_pick_of_initials_and_color_algo(
286 def test_initials_gravatar_pick_of_initials_and_color_algo(
286 email, first_name, last_name, expected_initials, expected_color):
287 email, first_name, last_name, expected_initials, expected_color):
General Comments 0
You need to be logged in to leave comments. Login now