[openstreetmap/openstreetmap-website] Remove ability to upload/edit traces from blocked users (PR #4129)
Anton Khorev
notifications at github.com
Fri Aug 18 17:04:26 UTC 2023
@AntonKhorev commented on this pull request.
> @@ -262,6 +262,25 @@ def icon
private
+ def deny_html_access_for_current_user(exception)
+ user_block = current_user.blocks.active.take
+ if exception.action == :new || exception.action == :create
+ render_blocked_from_writes user_block, :index unless user_block.nil?
What is the correct action? The user tries to upload a trace, that's not going to work.
`action=new` shows the upload form, but we want to stop the user before the potentially long upload happens, so we redirect away from the form.
Another approach would have been disabling the 'upload a trace' button and telling the user that they're blocked right away on the index page. But then something else needs to be done if the user manages to make the upload request.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4129#discussion_r1298673364
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/4129/review/1584919595 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230818/c7f1287b/attachment.htm>
More information about the rails-dev
mailing list