[openstreetmap/openstreetmap-website] Add moderation zones where anynomous notes are not allowed (PR #6713)

Pablo Brasero notifications at github.com
Thu Feb 5 12:03:43 UTC 2026


@pablobm commented on this pull request.

Addressed the simpler pieces of feedback. I'm going to look into the Ruby 3.2 question now and will report back.

Incidentally, I can't edit the title of the PR any more and I have now seen the typo! My eyes! :sob: Judging from a different comment elsewhere, this seems to be a change in GitHub.

> @@ -19,8 +19,18 @@ def status
 
   # Raised when access is denied.
   class APIAccessDenied < APIError
-    def initialize
-      super("Access denied")
+    def initialize(message = "Access denied")
+      super
+    end
+
+    def status
+      :forbidden
+    end
+  end
+
+  class APIModerationZoneError < APIAccessDenied
+    def initialize(message = "Attempted to edit a Moderation Zone without enough trust")

Going with "You don't have permissions to make changes in this zone, as it is currently protected by moderators".

> @@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+  factory :coordinates, :class => Struct.new(:lat, :lon) do
+    trait :inside_seville_cathedral do

Since it's used only in one test, I'm ok with either option. I do use FactoryBot a bit liberally and this showed here :slightly_smiling_face: Moved to a helper now.

> @@ -0,0 +1,26 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+  factory :moderation_zone do
+    sequence(:name) { |n| "Zone block #{n}" }
+    sequence(:reason) { |n| "Reason for block #{n}" }

Going for "Reason #{n}".

> @@ -0,0 +1,40 @@
+# frozen_string_literal: true
+
+# == Schema Information
+#
+# Table name: moderation_zones
+#
+#  id            :bigint           not null, primary key
+#  name          :string           not null
+#  reason        :string           not null
+#  reason_format :enum             default("markdown")
+#  zone          :st_geometry      not null, geometry, 0

I don't think I have much choice here, as it's automatically generated. However: doesn't 4326 imply geography? I'm totally ignorant on this topic, but that was the impression I got after switching between the two options a few times.

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

Message ID: <openstreetmap/openstreetmap-website/pull/6713/review/3756595138 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260205/b7d0f9cc/attachment.htm>


More information about the rails-dev mailing list