<p dir="auto"><code class="notranslate">scope_enabled?</code> returns nil if there's no <code class="notranslate">doorkeeper_token</code>, then <code class="notranslate">author</code> stays undefined. The else branch removed in this PR would have done the same because there's no <code class="notranslate">current_user</code> in this case too.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/5544'>https://github.com/openstreetmap/openstreetmap-website/pull/5544</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5544/commits/47d55a2b0f6057cb96b2bd4c98748f87365d8d02" class="commit-link">47d55a2</a>  Simplify write_notes scope check in api notes controller</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5544/files">2 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5544/files#diff-6e9fe051c0ef757618e376ffe731dfca8d4960ef0838b7d6a05609b46ba0fad1">app/controllers/api/notes_controller.rb</a>
    (6)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5544/files#diff-b4cc80ae5a4279eef2a7494cb8c489220ce03acaf36932b2042247df9d316908">test/controllers/api/notes_controller_test.rb</a>
    (11)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5544.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5544.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5544.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5544.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5544">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLPNXQJZRG5BDTQ3XTL2MGWSJAVCNFSM6AAAAABVYYOOWCVHI2DSMVQWIX3LMV43ASLTON2WKOZSHAYDQNBQGQZTGMA">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLPKP4BXYO7JGVLKTL32MGWSJA5CNFSM6AAAAABVYYOOWCWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHKOZGZNI.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5544</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5544",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5544",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>