[openstreetmap/openstreetmap-website] Simplify write_notes scope check in api notes controller (PR #5544)

Anton Khorev notifications at github.com
Fri Jan 24 03:21:08 UTC 2025


`scope_enabled?` returns nil if there's no `doorkeeper_token`, then `author` stays undefined. The else branch removed in this PR would have done the same because there's no `current_user` in this case too.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/5544

-- Commit Summary --

  * Simplify write_notes scope check in api notes controller

-- File Changes --

    M app/controllers/api/notes_controller.rb (6)
    M test/controllers/api/notes_controller_test.rb (11)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/5544.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5544.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/5544
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/5544 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250123/f9436384/attachment.htm>


More information about the rails-dev mailing list