Added the default permission in settings.py

This commit is contained in:
fazledyn-or 2023-10-11 11:50:56 +06:00
parent 90bcac954f
commit 11327e7469
2 changed files with 10 additions and 2 deletions

View File

@ -1144,7 +1144,7 @@ class FollowUpAttachment(Attachment):
att_path = os.path.join(settings.MEDIA_ROOT, path)
if settings.DEFAULT_FILE_STORAGE == "django.core.files.storage.FileSystemStorage":
if not os.path.exists(att_path):
os.makedirs(att_path, 0o755)
os.makedirs(att_path, helpdesk_settings.HELPDESK_ATTACHMENT_DIR_PERMS)
return os.path.join(path, filename)
@ -1164,7 +1164,7 @@ class KBIAttachment(Attachment):
att_path = os.path.join(settings.MEDIA_ROOT, path)
if settings.DEFAULT_FILE_STORAGE == "django.core.files.storage.FileSystemStorage":
if not os.path.exists(att_path):
os.makedirs(att_path, 0o755)
os.makedirs(att_path, helpdesk_settings.HELPDESK_ATTACHMENT_DIR_PERMS)
return os.path.join(path, filename)

View File

@ -265,3 +265,11 @@ HELPDESK_OAUTH = getattr(
# Set Debug Logging Level for IMAP Services. Default to '0' for No Debugging
HELPDESK_IMAP_DEBUG_LEVEL = getattr(settings, 'HELPDESK_IMAP_DEBUG_LEVEL', 0)
#############################################
# file permissions - Attachment directories #
#############################################
# Attachment directories should be created with permission 755 (rwxr-xr-x)
# Override it in your own Django settings.py
HELPDESK_ATTACHMENT_DIR_PERMS = int(getattr(settings, 'HELPDESK_ATTACHMENT_DIR_PERMS', "755"), 8)