diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 81fd1286..4747c0c0 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -58,7 +58,7 @@ class PostsController < ApplicationController @post.assign_attributes(post_create_params(is_anonymous: is_anonymous)) # handle attachments - if Current.tenant.tenant_setting.allow_attachment_upload && params[:post][:attachments].present? + if Current.tenant.tenant_setting.allow_attachment_upload && params[:post][:attachments].present? && !is_anonymous @post.attachments.attach(params[:post][:attachments]) end diff --git a/app/javascript/components/Board/NewPostForm.tsx b/app/javascript/components/Board/NewPostForm.tsx index 8258d788..a08ec385 100644 --- a/app/javascript/components/Board/NewPostForm.tsx +++ b/app/javascript/components/Board/NewPostForm.tsx @@ -112,7 +112,7 @@ const NewPostForm = ({ { /* Attachments */ } { - tenantSetting.allow_attachment_upload && + tenantSetting.allow_attachment_upload && !isSubmissionAnonymous &&