mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-11-21 23:43:11 +01:00
Fixed file permission(s) in models.py/attachment_path
This commit is contained in:
parent
67eb0974c7
commit
90bcac954f
@ -1137,7 +1137,6 @@ class FollowUpAttachment(Attachment):
|
||||
|
||||
def attachment_path(self, filename):
|
||||
|
||||
os.umask(0)
|
||||
path = 'helpdesk/attachments/{ticket_for_url}-{secret_key}/{id_}'.format(
|
||||
ticket_for_url=self.followup.ticket.ticket_for_url,
|
||||
secret_key=self.followup.ticket.secret_key,
|
||||
@ -1145,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, 0o777)
|
||||
os.makedirs(att_path, 0o755)
|
||||
return os.path.join(path, filename)
|
||||
|
||||
|
||||
@ -1159,14 +1158,13 @@ class KBIAttachment(Attachment):
|
||||
|
||||
def attachment_path(self, filename):
|
||||
|
||||
os.umask(0)
|
||||
path = 'helpdesk/attachments/kb/{category}/{kbi}'.format(
|
||||
category=self.kbitem.category,
|
||||
kbi=self.kbitem.id)
|
||||
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, 0o777)
|
||||
os.makedirs(att_path, 0o755)
|
||||
return os.path.join(path, filename)
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user