mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 19:57:52 +01:00
disable image upload for anonymous feedback
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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}
|
||||||
|
|||||||
Reference in New Issue
Block a user