gravatar not displayed if mail not part of author

Issue #531 resolved
domruf created an issue

rhodecode/templates/changeset/changeset.html uses rhodecode/lib/vcs/utils/>author_email to get the email of the author

This function does not consult the DB for the email of the author but only looks if the author text contains an email. I think the author_email function should try to find an email in the DB.

Comments (12)

  1. Marcin Kuzminski repo owner

    I think it's a small bug, it should be h.person (which get's info from db) instead of

  2. Marcin Kuzminski repo owner

    ahh sory I'm wrong person returns username in case we match in DB, it should be email_or_none which try to match email if no email try to match username in rhodecode DB, and get email from this user

  3. domruf reporter

    Thanks email_or_none works Should I create a pull request or did you already change the file in your sources?

  4. domruf reporter

    sorry for reopening this but there are more files with the same problem

    rhodecode\templates\admin\notifications\notifications_data.html rhodecode\templates\admin\notifications\show_notification.html rhodecode\templates\changelog\changelog.html rhodecode\templates\changeset\changeset_range.html rhodecode\templates\compare\compare_cs.html rhodecode\templates\files\files_source.html rhodecode\templates\search\search_commit.html

  5. Marcin Kuzminski repo owner

    I don't know why i didn't check other occurrences good you checked that ! Thanks.

  6. domruf reporter

    sorry still one missing :-) rhodecode\templates\files\files_source.html I fixed it like this

    @@ -14,7 +14,7 @@
                     <div class="item">${h.literal(ungettext(u'%s author',u'%s authors',len(c.authors)) % ('<b>%s</b>' % len(c.authors))) }</div>
                     %for email, user in c.authors:
                       <div class="contributor tooltip" style="float:left" title="${h.tooltip(user)}">
    -                    <div class="gravatar" style="margin:1px"><img alt="gravatar" src="${h.gravatar_url(email, 20)}"/> </div>
    +                    <div class="gravatar" style="margin:1px"><img alt="gravatar" src="${h.gravatar_url(h.email_or_none(user), 20)}"/> </div>
  7. Marcin Kuzminski repo owner

    We have completly change the mapping in RC 3.5, now there's a concept of user profiles that we have. Also checked all the code that was doing the mapping. It's now very consistent, and this issue should be fixed.

  8. Log in to comment