✨(backend) manage uploaded file status and call to malware detection
In the attachment_upload method, the status in the file metadata to processing and the malware_detection backend is called. We check in the media_auth if the status is ready in order to accept the request.
This commit is contained in:
@@ -10,6 +10,7 @@ from core.enums import DocumentAttachmentStatus
|
||||
from core.models import Document
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
security_logger = logging.getLogger("docs.security")
|
||||
|
||||
|
||||
def malware_detection_callback(file_path, status, error_info, **kwargs):
|
||||
@@ -35,7 +36,7 @@ def malware_detection_callback(file_path, status, error_info, **kwargs):
|
||||
return
|
||||
|
||||
document_id = kwargs.get("document_id")
|
||||
logger.error(
|
||||
security_logger.warning(
|
||||
"File %s for document %s is infected with malware. Error info: %s",
|
||||
file_path,
|
||||
document_id,
|
||||
|
||||
Reference in New Issue
Block a user