Rename and document the maximum email attachment size setting, to address #846

This commit is contained in:
Garret Wassermann 2020-07-30 02:54:03 -04:00
parent 981eb323c2
commit 2a3fc0894d
3 changed files with 10 additions and 2 deletions

View File

@ -82,6 +82,10 @@ These changes are visible throughout django-helpdesk
**Default:** ``HELPDESK_EMAIL_FALLBACK_LOCALE = "en"``
- **HELPDESK_MAX_EMAIL_ATTACHMENT_SIZE** Maximum size, in bytes, of file attachments that will be sent via email
**Default:** ``HELPDESK_MAX_EMAIL_ATTACHMENT_SIZE = 512000``
- **QUEUE_EMAIL_BOX_UPDATE_ONLY** Only process mail with a valid tracking ID; all other mail will be ignored instead of creating a new ticket.
**Default:** ``QUEUE_EMAIL_BOX_UPDATE_ONLY = False``

View File

@ -311,7 +311,7 @@ def text_is_spam(text, request):
def process_attachments(followup, attached_files):
max_email_attachment_size = getattr(settings, 'MAX_EMAIL_ATTACHMENT_SIZE', 512000)
max_email_attachment_size = getattr(settings, 'HELPDESK_MAX_EMAIL_ATTACHMENT_SIZE', 512000)
attachments = []
for attached in attached_files:
@ -330,7 +330,7 @@ def process_attachments(followup, attached_files):
if attached.size < max_email_attachment_size:
# Only files smaller than 512kb (or as defined in
# settings.MAX_EMAIL_ATTACHMENT_SIZE) are sent via email.
# settings.HELPDESK_MAX_EMAIL_ATTACHMENT_SIZE) are sent via email.
attachments.append([filename, att.file])
return attachments

View File

@ -122,6 +122,10 @@ if HELPDESK_EMAIL_SUBJECT_TEMPLATE.find("ticket.ticket") < 0:
# default fallback locale when queue locale not found
HELPDESK_EMAIL_FALLBACK_LOCALE = getattr(settings, 'HELPDESK_EMAIL_FALLBACK_LOCALE', 'en')
# default maximum email attachment size, in bytes
# only attachments smaller than this size will be sent via email
HELPDESK_MAX_EMAIL_ATTACHMENT_SIZE = getattr(settings, 'HELPDESK_MAX_EMAIL_ATTACHMENT_SIZE', 512000)
########################################
# options for staff.create_ticket view #