https://www.redmine.org/https://www.redmine.org/favicon.ico?16793021292022-05-25T01:06:25ZRedmineRedmine - Defect #37157: Internal server error when trying to retrieve AnonymousUser's information via Users APIhttps://www.redmine.org/issues/37157?journal_id=1067762022-05-25T01:06:25ZGo MAEDA
<ul><li><strong>Related to</strong> <i><a class="issue tracker-2 status-5 priority-4 priority-default closed" href="/issues/36303">Feature #36303</a>: Include avatar URL in Users API</i> added</li></ul> Redmine - Defect #37157: Internal server error when trying to retrieve AnonymousUser's information via Users APIhttps://www.redmine.org/issues/37157?journal_id=1067902022-05-26T04:49:02ZYuichi HARADA
<ul><li><strong>File</strong> <a href="/attachments/29235">37157.patch</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/29235/37157.patch">37157.patch</a> added</li></ul><p>Users API was raised with an exception because AnonymousUser has no email address set.<br />The following patch will solve the problem.</p>
<pre><code class="diff syntaxhl"><span class="gh">diff --git a/app/views/users/show.api.rsb b/app/views/users/show.api.rsb
index f6a323265a..d84be914ec 100644
</span><span class="gd">--- a/app/views/users/show.api.rsb
</span><span class="gi">+++ b/app/views/users/show.api.rsb
</span><span class="p">@@ -9,7 +9,7 @@</span> api.user do
api.updated_on @user.updated_on
api.last_login_on @user.last_login_on
api.passwd_changed_on @user.passwd_changed_on
<span class="gd">- api.avatar_url gravatar_url(@user.mail, {rating: nil, size: nil, default: Setting.gravatar_default}) if Setting.gravatar_enabled?
</span><span class="gi">+ api.avatar_url gravatar_url(@user.mail, {rating: nil, size: nil, default: Setting.gravatar_default}) if @user.mail && Setting.gravatar_enabled?
</span> api.twofa_scheme @user.twofa_scheme if User.current.admin? || (User.current == @user)
api.api_key @user.api_key if User.current.admin? || (User.current == @user)
api.status @user.status if User.current.admin?
</code></pre> Redmine - Defect #37157: Internal server error when trying to retrieve AnonymousUser's information via Users APIhttps://www.redmine.org/issues/37157?journal_id=1068052022-05-27T18:54:20ZMarius BĂLTEANU
<ul><li><strong>Target version</strong> set to <i>5.0.2</i></li></ul> Redmine - Defect #37157: Internal server error when trying to retrieve AnonymousUser's information via Users APIhttps://www.redmine.org/issues/37157?journal_id=1068162022-05-28T09:56:02ZMarius BĂLTEANU
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li><li><strong>Assignee</strong> set to <i>Marius BĂLTEANU</i></li><li><strong>Resolution</strong> set to <i>Fixed</i></li></ul><p>Fixed committed, thanks!</p>