disable image upload for anonymous feedback

This commit is contained in:
riggraz
2025-02-05 15:51:37 +01:00
parent 60819ce357
commit edc1a853aa
2 changed files with 2 additions and 2 deletions

View File

@@ -58,7 +58,7 @@ class PostsController < ApplicationController
@post.assign_attributes(post_create_params(is_anonymous: is_anonymous)) @post.assign_attributes(post_create_params(is_anonymous: is_anonymous))
# handle attachments # 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]) @post.attachments.attach(params[:post][:attachments])
end end

View File

@@ -112,7 +112,7 @@ const NewPostForm = ({
{ /* Attachments */ } { /* Attachments */ }
{ {
tenantSetting.allow_attachment_upload && tenantSetting.allow_attachment_upload && !isSubmissionAnonymous &&
<div className="form-group"> <div className="form-group">
<Dropzone <Dropzone
files={attachments} files={attachments}