[openstreetmap/openstreetmap-website] Add validation of report parameters (PR #7037)
Tom Hughes
notifications at github.com
Sun Apr 26 17:57:46 UTC 2026
@tomhughes commented on this pull request.
> @@ -46,6 +45,16 @@ def required_new_report_params_present?
create_new_report_params["reportable_id"].present? && create_new_report_params["reportable_type"].present?
end
+ def new_report_params_valid?
+ id = create_new_report_params["reportable_id"]
+ type = create_new_report_params["reportable_type"]
+
+ (type == "DiaryComment" && DiaryComment.exists?(id)) ||
The outermost parentheses aren't necessary here?
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/7037#pullrequestreview-4177240258
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/7037/review/4177240258 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260426/42d1d41b/attachment.htm>
More information about the rails-dev
mailing list