[openstreetmap/openstreetmap-website] Remove ability to upload/edit traces from blocked users (PR #4129)

Anton Khorev notifications at github.com
Fri Aug 18 17:06:41 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?
+    else
+      render_blocked_from_writes user_block, :show unless user_block.nil?
+    end
+  end
+
+  def render_blocked_from_writes(user_block, action)
+    respond_to do |format|
+      format.html do
+        flash[:warning] = { :partial => "traces/blocked_flash", :locals => { :action => action, :block_link => user_block_path(user_block) } }
+        redirect_to :action => action, :display_name => current_user.display_name

It also redirects away from create/edit forms.

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

Message ID: <openstreetmap/openstreetmap-website/pull/4129/review/1584922466 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230818/49d68d39/attachment.htm>


More information about the rails-dev mailing list