2009-09-09 11:11:05 +02:00
|
|
|
"""
|
2011-01-26 00:08:41 +01:00
|
|
|
Default settings for django-helpdesk.
|
2009-09-09 11:11:05 +02:00
|
|
|
|
|
|
|
"""
|
2022-03-31 17:19:49 +02:00
|
|
|
|
|
|
|
from django import forms
|
2009-09-09 11:11:05 +02:00
|
|
|
from django.conf import settings
|
2014-07-30 06:35:52 +02:00
|
|
|
from django.core.exceptions import ImproperlyConfigured
|
2024-01-24 10:59:51 +01:00
|
|
|
from django.utils.translation import gettext_lazy as _
|
2022-07-22 03:26:41 +02:00
|
|
|
import os
|
2023-12-05 00:36:20 +01:00
|
|
|
import re
|
2022-07-22 03:26:41 +02:00
|
|
|
import warnings
|
2024-04-22 18:33:58 +02:00
|
|
|
import sys
|
2022-07-22 03:26:41 +02:00
|
|
|
|
2009-09-09 11:11:05 +02:00
|
|
|
|
2018-10-05 14:54:22 +02:00
|
|
|
DEFAULT_USER_SETTINGS = {
|
|
|
|
'login_view_ticketlist': True,
|
|
|
|
'email_on_ticket_change': True,
|
|
|
|
'email_on_ticket_assign': True,
|
|
|
|
'tickets_per_page': 25,
|
|
|
|
'use_email_as_submitter': True,
|
|
|
|
}
|
2011-02-02 09:15:49 +01:00
|
|
|
|
|
|
|
try:
|
2018-10-05 14:54:22 +02:00
|
|
|
DEFAULT_USER_SETTINGS.update(settings.HELPDESK_DEFAULT_SETTINGS)
|
2017-12-06 08:21:46 +01:00
|
|
|
except AttributeError:
|
2018-10-05 14:54:22 +02:00
|
|
|
pass
|
2011-06-09 17:24:33 +02:00
|
|
|
|
2011-11-28 15:17:54 +01:00
|
|
|
|
2014-03-04 21:20:47 +01:00
|
|
|
HAS_TAG_SUPPORT = False
|
2011-11-28 15:17:54 +01:00
|
|
|
|
2022-06-28 16:08:13 +02:00
|
|
|
# Use international timezones
|
|
|
|
USE_TZ: bool = True
|
|
|
|
|
2021-09-28 04:12:32 +02:00
|
|
|
# check for secure cookie support
|
|
|
|
if os.environ.get('SECURE_PROXY_SSL_HEADER'):
|
|
|
|
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
|
|
|
|
|
|
|
SESSION_COOKIE_SECURE = True
|
|
|
|
CSRF_COOKIE_SECURE = True
|
|
|
|
|
2016-10-21 17:14:12 +02:00
|
|
|
##########################################
|
|
|
|
# generic options - visible on all pages #
|
|
|
|
##########################################
|
|
|
|
|
2011-11-19 09:34:07 +01:00
|
|
|
# redirect to login page instead of the default homepage when users visits "/"?
|
2016-10-21 17:14:12 +02:00
|
|
|
HELPDESK_REDIRECT_TO_LOGIN_BY_DEFAULT = getattr(settings,
|
|
|
|
'HELPDESK_REDIRECT_TO_LOGIN_BY_DEFAULT',
|
|
|
|
False)
|
2011-11-19 09:34:07 +01:00
|
|
|
|
2024-02-18 10:04:01 +01:00
|
|
|
HELPDESK_PUBLIC_VIEW_PROTECTOR = getattr(settings,
|
|
|
|
'HELPDESK_PUBLIC_VIEW_PROTECTOR',
|
|
|
|
lambda _: None)
|
|
|
|
|
|
|
|
HELPDESK_STAFF_VIEW_PROTECTOR = getattr(settings,
|
|
|
|
'HELPDESK_STAFF_VIEW_PROTECTOR',
|
|
|
|
lambda _: None)
|
|
|
|
|
2024-06-06 15:47:50 +02:00
|
|
|
# Enable ticket and Email attachments
|
|
|
|
HELPDESK_ENABLE_ATTACHMENTS = getattr(settings,
|
|
|
|
'HELPDESK_ENABLE_ATTACHMENTS',
|
|
|
|
False)
|
|
|
|
|
2022-04-20 16:36:37 +02:00
|
|
|
# Enable the Dependencies field on ticket view
|
|
|
|
HELPDESK_ENABLE_DEPENDENCIES_ON_TICKET = getattr(settings,
|
2022-07-12 12:34:19 +02:00
|
|
|
'HELPDESK_ENABLE_DEPENDENCIES_ON_TICKET',
|
|
|
|
True)
|
2022-04-20 16:36:37 +02:00
|
|
|
|
|
|
|
# Enable the Time spent on field on ticket view
|
|
|
|
HELPDESK_ENABLE_TIME_SPENT_ON_TICKET = getattr(settings,
|
2022-07-12 12:34:19 +02:00
|
|
|
'HELPDESK_ENABLE_TIME_SPENT_ON_TICKET',
|
|
|
|
True)
|
2022-04-20 16:36:37 +02:00
|
|
|
|
2017-10-04 03:42:26 +02:00
|
|
|
# raises a 404 to anon users. It's like it was invisible
|
|
|
|
HELPDESK_ANON_ACCESS_RAISES_404 = getattr(settings,
|
|
|
|
'HELPDESK_ANON_ACCESS_RAISES_404',
|
|
|
|
False)
|
|
|
|
|
2022-04-15 18:48:21 +02:00
|
|
|
# Disable Timeline on ticket list
|
2022-07-12 12:34:19 +02:00
|
|
|
HELPDESK_TICKETS_TIMELINE_ENABLED = getattr(
|
|
|
|
settings, 'HELPDESK_TICKETS_TIMELINE_ENABLED', True)
|
2022-04-15 18:48:21 +02:00
|
|
|
|
2022-07-12 12:34:19 +02:00
|
|
|
# show extended navigation by default, to all users, irrespective of staff
|
|
|
|
# status?
|
|
|
|
HELPDESK_NAVIGATION_ENABLED = getattr(
|
|
|
|
settings, 'HELPDESK_NAVIGATION_ENABLED', False)
|
2011-11-19 09:34:07 +01:00
|
|
|
|
2016-10-21 17:14:12 +02:00
|
|
|
# use public CDNs to serve jquery and other javascript by default?
|
|
|
|
# otherwise, use built-in static copy
|
2016-08-05 06:38:17 +02:00
|
|
|
HELPDESK_USE_CDN = getattr(settings, 'HELPDESK_USE_CDN', False)
|
|
|
|
|
2011-11-21 17:39:13 +01:00
|
|
|
# show dropdown list of languages that ticket comments can be translated into?
|
2016-10-21 17:14:12 +02:00
|
|
|
HELPDESK_TRANSLATE_TICKET_COMMENTS = getattr(settings,
|
|
|
|
'HELPDESK_TRANSLATE_TICKET_COMMENTS',
|
|
|
|
False)
|
2011-11-21 17:39:13 +01:00
|
|
|
|
2016-10-21 17:14:12 +02:00
|
|
|
# list of languages to offer. if set to false,
|
|
|
|
# all default google translate languages will be shown.
|
|
|
|
HELPDESK_TRANSLATE_TICKET_COMMENTS_LANG = getattr(settings,
|
|
|
|
'HELPDESK_TRANSLATE_TICKET_COMMENTS_LANG',
|
2017-07-17 09:56:22 +02:00
|
|
|
["en", "de", "es", "fr", "it", "ru"])
|
2011-11-21 17:39:13 +01:00
|
|
|
|
2011-11-24 13:30:45 +01:00
|
|
|
# show link to 'change password' on 'User Settings' page?
|
2022-07-12 12:34:19 +02:00
|
|
|
HELPDESK_SHOW_CHANGE_PASSWORD = getattr(
|
|
|
|
settings, 'HELPDESK_SHOW_CHANGE_PASSWORD', False)
|
2011-11-24 13:30:45 +01:00
|
|
|
|
2011-11-21 20:04:05 +01:00
|
|
|
# allow user to override default layout for 'followups' - work in progress.
|
|
|
|
HELPDESK_FOLLOWUP_MOD = getattr(settings, 'HELPDESK_FOLLOWUP_MOD', False)
|
|
|
|
|
2012-08-07 15:41:43 +02:00
|
|
|
# auto-subscribe user to ticket if (s)he responds to a ticket?
|
2016-10-21 17:14:12 +02:00
|
|
|
HELPDESK_AUTO_SUBSCRIBE_ON_TICKET_RESPONSE = getattr(settings,
|
|
|
|
'HELPDESK_AUTO_SUBSCRIBE_ON_TICKET_RESPONSE',
|
|
|
|
False)
|
|
|
|
|
2021-11-22 05:25:54 +01:00
|
|
|
# URL schemes that are allowed within links
|
|
|
|
ALLOWED_URL_SCHEMES = getattr(settings, 'ALLOWED_URL_SCHEMES', (
|
2022-07-12 12:34:19 +02:00
|
|
|
'file', 'ftp', 'ftps', 'http', 'https', 'irc', 'mailto', 'sftp', 'ssh', 'tel', 'telnet', 'tftp', 'vnc', 'xmpp',
|
2021-11-22 05:25:54 +01:00
|
|
|
))
|
2024-01-22 15:30:44 +01:00
|
|
|
|
2024-02-01 15:38:02 +01:00
|
|
|
# Ticket status choices
|
|
|
|
OPEN_STATUS = getattr(settings, 'HELPDESK_TICKET_OPEN_STATUS', 1)
|
|
|
|
REOPENED_STATUS = getattr(settings, 'HELPDESK_TICKET_REOPENED_STATUS', 2)
|
|
|
|
RESOLVED_STATUS = getattr(settings, 'HELPDESK_TICKET_RESOLVED_STATUS', 3)
|
|
|
|
CLOSED_STATUS = getattr(settings, 'HELPDESK_TICKET_CLOSED_STATUS', 4)
|
|
|
|
DUPLICATE_STATUS = getattr(settings, 'HELPDESK_TICKET_DUPLICATE_STATUS', 5)
|
|
|
|
|
|
|
|
DEFAULT_TICKET_STATUS_CHOICES = (
|
|
|
|
(OPEN_STATUS, _('Open')),
|
|
|
|
(REOPENED_STATUS, _('Reopened')),
|
|
|
|
(RESOLVED_STATUS, _('Resolved')),
|
|
|
|
(CLOSED_STATUS, _('Closed')),
|
|
|
|
(DUPLICATE_STATUS, _('Duplicate')),
|
|
|
|
)
|
|
|
|
TICKET_STATUS_CHOICES = getattr(settings,
|
|
|
|
'HELPDESK_TICKET_STATUS_CHOICES',
|
|
|
|
DEFAULT_TICKET_STATUS_CHOICES)
|
|
|
|
|
2024-02-05 10:58:42 +01:00
|
|
|
# List of status choices considered as "open"
|
2024-02-01 15:38:02 +01:00
|
|
|
DEFAULT_TICKET_OPEN_STATUSES = (OPEN_STATUS, REOPENED_STATUS)
|
|
|
|
TICKET_OPEN_STATUSES = getattr(settings,
|
|
|
|
'HELPDESK_TICKET_OPEN_STATUSES',
|
|
|
|
DEFAULT_TICKET_OPEN_STATUSES)
|
|
|
|
|
2024-02-05 10:58:42 +01:00
|
|
|
# New status list choices depending on current ticket status
|
|
|
|
DEFAULT_TICKET_STATUS_CHOICES_FLOW = {
|
|
|
|
OPEN_STATUS: (OPEN_STATUS, RESOLVED_STATUS, CLOSED_STATUS, DUPLICATE_STATUS,),
|
|
|
|
REOPENED_STATUS: (REOPENED_STATUS, RESOLVED_STATUS, CLOSED_STATUS, DUPLICATE_STATUS,),
|
|
|
|
RESOLVED_STATUS: (REOPENED_STATUS, RESOLVED_STATUS, CLOSED_STATUS,),
|
|
|
|
CLOSED_STATUS: (REOPENED_STATUS, CLOSED_STATUS,),
|
|
|
|
DUPLICATE_STATUS: (REOPENED_STATUS, DUPLICATE_STATUS,),
|
|
|
|
}
|
|
|
|
TICKET_STATUS_CHOICES_FLOW = getattr(settings,
|
|
|
|
'HELPDESK_TICKET_STATUS_CHOICES_FLOW',
|
|
|
|
DEFAULT_TICKET_STATUS_CHOICES_FLOW)
|
|
|
|
|
2024-01-22 15:30:44 +01:00
|
|
|
# Ticket priority choices
|
2024-01-22 15:39:53 +01:00
|
|
|
DEFAULT_TICKET_PRIORITY_CHOICES = (
|
2024-01-22 15:30:44 +01:00
|
|
|
(1, _('1. Critical')),
|
|
|
|
(2, _('2. High')),
|
|
|
|
(3, _('3. Normal')),
|
|
|
|
(4, _('4. Low')),
|
|
|
|
(5, _('5. Very Low')),
|
|
|
|
)
|
2024-01-22 15:39:53 +01:00
|
|
|
TICKET_PRIORITY_CHOICES = getattr(settings,
|
2024-02-01 15:38:02 +01:00
|
|
|
'HELPDESK_TICKET_PRIORITY_CHOICES',
|
|
|
|
DEFAULT_TICKET_PRIORITY_CHOICES)
|
2024-01-22 15:30:44 +01:00
|
|
|
|
2024-02-13 10:30:21 +01:00
|
|
|
|
|
|
|
#########################
|
|
|
|
# time tracking options #
|
|
|
|
#########################
|
|
|
|
|
2024-02-13 09:59:48 +01:00
|
|
|
# Follow-ups automatic time_spent calculation
|
|
|
|
FOLLOWUP_TIME_SPENT_AUTO = getattr(settings,
|
|
|
|
'HELPDESK_FOLLOWUP_TIME_SPENT_AUTO',
|
|
|
|
False)
|
|
|
|
|
2024-02-14 11:16:20 +01:00
|
|
|
# Calculate time_spent according to open hours
|
|
|
|
FOLLOWUP_TIME_SPENT_OPENING_HOURS = getattr(settings,
|
|
|
|
'HELPDESK_FOLLOWUP_TIME_SPENT_OPENING_HOURS',
|
|
|
|
{})
|
|
|
|
|
2024-02-14 14:03:58 +01:00
|
|
|
# Holidays don't count for time_spent calculation
|
2024-02-14 14:21:19 +01:00
|
|
|
FOLLOWUP_TIME_SPENT_EXCLUDE_HOLIDAYS = getattr(settings,
|
2024-02-14 14:03:58 +01:00
|
|
|
'HELPDESK_FOLLOWUP_TIME_SPENT_EXCLUDE_HOLIDAYS',
|
|
|
|
())
|
|
|
|
|
2024-02-14 14:21:19 +01:00
|
|
|
# Time doesn't count for listed ticket statuses
|
2024-02-14 14:23:15 +01:00
|
|
|
FOLLOWUP_TIME_SPENT_EXCLUDE_STATUSES = getattr(settings,
|
|
|
|
'HELPDESK_FOLLOWUP_TIME_SPENT_EXCLUDE_STATUSES',
|
2024-02-14 14:21:19 +01:00
|
|
|
())
|
|
|
|
|
2024-02-14 14:36:46 +01:00
|
|
|
# Time doesn't count for listed queues slugs
|
|
|
|
FOLLOWUP_TIME_SPENT_EXCLUDE_QUEUES = getattr(settings,
|
|
|
|
'HELPDESK_FOLLOWUP_TIME_SPENT_EXCLUDE_QUEUES',
|
|
|
|
())
|
|
|
|
|
2016-10-21 17:14:12 +02:00
|
|
|
############################
|
|
|
|
# options for public pages #
|
|
|
|
############################
|
2011-11-19 09:34:07 +01:00
|
|
|
|
|
|
|
# show 'view a ticket' section on public page?
|
2022-07-12 12:34:19 +02:00
|
|
|
HELPDESK_VIEW_A_TICKET_PUBLIC = getattr(
|
|
|
|
settings, 'HELPDESK_VIEW_A_TICKET_PUBLIC', True)
|
2011-11-19 09:34:07 +01:00
|
|
|
|
|
|
|
# show 'submit a ticket' section on public page?
|
2022-07-12 12:34:19 +02:00
|
|
|
HELPDESK_SUBMIT_A_TICKET_PUBLIC = getattr(
|
|
|
|
settings, 'HELPDESK_SUBMIT_A_TICKET_PUBLIC', True)
|
2011-11-19 09:34:07 +01:00
|
|
|
|
2021-03-02 12:06:21 +01:00
|
|
|
# change that to custom class to have extra fields or validation (like captcha)
|
|
|
|
HELPDESK_PUBLIC_TICKET_FORM_CLASS = getattr(
|
|
|
|
settings,
|
|
|
|
"HELPDESK_PUBLIC_TICKET_FORM_CLASS",
|
|
|
|
"helpdesk.forms.PublicTicketForm"
|
|
|
|
)
|
|
|
|
|
2022-03-31 17:19:49 +02:00
|
|
|
# Custom fields constants
|
|
|
|
CUSTOMFIELD_TO_FIELD_DICT = {
|
|
|
|
'boolean': forms.BooleanField,
|
|
|
|
'date': forms.DateField,
|
|
|
|
'time': forms.TimeField,
|
|
|
|
'datetime': forms.DateTimeField,
|
|
|
|
'email': forms.EmailField,
|
|
|
|
'url': forms.URLField,
|
|
|
|
'ipaddress': forms.GenericIPAddressField,
|
|
|
|
'slug': forms.SlugField,
|
|
|
|
}
|
|
|
|
CUSTOMFIELD_DATE_FORMAT = "%Y-%m-%d"
|
|
|
|
CUSTOMFIELD_TIME_FORMAT = "%H:%M:%S"
|
|
|
|
CUSTOMFIELD_DATETIME_FORMAT = f"{CUSTOMFIELD_DATE_FORMAT}T%H:%M"
|
|
|
|
|
2011-11-19 09:34:07 +01:00
|
|
|
|
2016-10-21 17:14:12 +02:00
|
|
|
###################################
|
|
|
|
# options for update_ticket views #
|
|
|
|
###################################
|
2011-11-28 15:17:54 +01:00
|
|
|
|
2011-11-19 09:34:07 +01:00
|
|
|
''' options for update_ticket views '''
|
2016-10-21 17:14:12 +02:00
|
|
|
# allow non-staff users to interact with tickets?
|
2022-07-12 12:34:19 +02:00
|
|
|
# can be True/False or a callable accepting the active user and returning
|
|
|
|
# True if they must be considered helpdesk staff
|
|
|
|
HELPDESK_ALLOW_NON_STAFF_TICKET_UPDATE = getattr(
|
|
|
|
settings, 'HELPDESK_ALLOW_NON_STAFF_TICKET_UPDATE', False)
|
2014-08-01 07:20:43 +02:00
|
|
|
if not (HELPDESK_ALLOW_NON_STAFF_TICKET_UPDATE in (True, False) or callable(HELPDESK_ALLOW_NON_STAFF_TICKET_UPDATE)):
|
2021-03-05 09:27:23 +01:00
|
|
|
warnings.warn(
|
|
|
|
"HELPDESK_ALLOW_NON_STAFF_TICKET_UPDATE should be set to either True/False or a callable.",
|
|
|
|
RuntimeWarning
|
|
|
|
)
|
2011-11-19 09:34:07 +01:00
|
|
|
|
|
|
|
# show edit buttons in ticket follow ups.
|
2016-10-21 17:14:12 +02:00
|
|
|
HELPDESK_SHOW_EDIT_BUTTON_FOLLOW_UP = getattr(settings,
|
|
|
|
'HELPDESK_SHOW_EDIT_BUTTON_FOLLOW_UP',
|
|
|
|
True)
|
2011-11-19 09:34:07 +01:00
|
|
|
|
2012-08-07 15:32:45 +02:00
|
|
|
# show delete buttons in ticket follow ups if user is 'superuser'
|
2016-10-21 17:14:12 +02:00
|
|
|
HELPDESK_SHOW_DELETE_BUTTON_SUPERUSER_FOLLOW_UP = getattr(
|
|
|
|
settings, 'HELPDESK_SHOW_DELETE_BUTTON_SUPERUSER_FOLLOW_UP', False)
|
2012-08-07 15:32:45 +02:00
|
|
|
|
2022-07-12 12:34:19 +02:00
|
|
|
# make all updates public by default? this will hide the 'is this update
|
|
|
|
# public' checkbox
|
|
|
|
HELPDESK_UPDATE_PUBLIC_DEFAULT = getattr(
|
|
|
|
settings, 'HELPDESK_UPDATE_PUBLIC_DEFAULT', False)
|
2011-11-19 09:34:07 +01:00
|
|
|
|
2015-06-11 12:18:45 +02:00
|
|
|
# only show staff users in ticket owner drop-downs
|
2022-07-12 12:34:19 +02:00
|
|
|
HELPDESK_STAFF_ONLY_TICKET_OWNERS = getattr(
|
|
|
|
settings, 'HELPDESK_STAFF_ONLY_TICKET_OWNERS', False)
|
2012-01-17 22:40:44 +01:00
|
|
|
|
2015-06-11 12:18:45 +02:00
|
|
|
# only show staff users in ticket cc drop-down
|
2022-07-12 12:34:19 +02:00
|
|
|
HELPDESK_STAFF_ONLY_TICKET_CC = getattr(
|
|
|
|
settings, 'HELPDESK_STAFF_ONLY_TICKET_CC', False)
|
2012-01-17 22:40:44 +01:00
|
|
|
|
2014-07-16 00:48:42 +02:00
|
|
|
# allow the subject to have a configurable template.
|
2016-10-21 17:14:12 +02:00
|
|
|
HELPDESK_EMAIL_SUBJECT_TEMPLATE = getattr(
|
|
|
|
settings, 'HELPDESK_EMAIL_SUBJECT_TEMPLATE',
|
|
|
|
"{{ ticket.ticket }} {{ ticket.title|safe }} %(subject)s")
|
2017-12-18 05:47:48 +01:00
|
|
|
# since django-helpdesk may not work correctly without the ticket ID
|
|
|
|
# in the subject, let's do a check for it quick:
|
|
|
|
if HELPDESK_EMAIL_SUBJECT_TEMPLATE.find("ticket.ticket") < 0:
|
|
|
|
raise ImproperlyConfigured
|
2014-07-16 00:48:42 +02:00
|
|
|
|
2016-10-14 10:04:28 +02:00
|
|
|
# default fallback locale when queue locale not found
|
2022-07-12 12:34:19 +02:00
|
|
|
HELPDESK_EMAIL_FALLBACK_LOCALE = getattr(
|
|
|
|
settings, 'HELPDESK_EMAIL_FALLBACK_LOCALE', 'en')
|
2016-10-14 10:04:28 +02:00
|
|
|
|
2020-07-30 08:54:03 +02:00
|
|
|
# default maximum email attachment size, in bytes
|
|
|
|
# only attachments smaller than this size will be sent via email
|
2022-07-12 12:34:19 +02:00
|
|
|
HELPDESK_MAX_EMAIL_ATTACHMENT_SIZE = getattr(
|
|
|
|
settings, 'HELPDESK_MAX_EMAIL_ATTACHMENT_SIZE', 512000)
|
2020-07-30 08:54:03 +02:00
|
|
|
|
2011-11-28 15:17:54 +01:00
|
|
|
|
2016-10-21 17:14:12 +02:00
|
|
|
########################################
|
|
|
|
# options for staff.create_ticket view #
|
|
|
|
########################################
|
|
|
|
|
2011-11-28 15:17:54 +01:00
|
|
|
# hide the 'assigned to' / 'Case owner' field from the 'create_ticket' view?
|
2016-10-21 17:14:12 +02:00
|
|
|
HELPDESK_CREATE_TICKET_HIDE_ASSIGNED_TO = getattr(
|
|
|
|
settings, 'HELPDESK_CREATE_TICKET_HIDE_ASSIGNED_TO', False)
|
2011-11-28 15:17:54 +01:00
|
|
|
|
|
|
|
|
2016-10-21 17:14:12 +02:00
|
|
|
#################
|
|
|
|
# email options #
|
|
|
|
#################
|
2011-11-28 15:17:54 +01:00
|
|
|
|
2012-01-17 02:01:47 +01:00
|
|
|
# default Queue email submission settings
|
|
|
|
QUEUE_EMAIL_BOX_TYPE = getattr(settings, 'QUEUE_EMAIL_BOX_TYPE', None)
|
2012-01-17 02:36:24 +01:00
|
|
|
QUEUE_EMAIL_BOX_SSL = getattr(settings, 'QUEUE_EMAIL_BOX_SSL', None)
|
2012-01-17 02:01:47 +01:00
|
|
|
QUEUE_EMAIL_BOX_HOST = getattr(settings, 'QUEUE_EMAIL_BOX_HOST', None)
|
|
|
|
QUEUE_EMAIL_BOX_USER = getattr(settings, 'QUEUE_EMAIL_BOX_USER', None)
|
|
|
|
QUEUE_EMAIL_BOX_PASSWORD = getattr(settings, 'QUEUE_EMAIL_BOX_PASSWORD', None)
|
2017-07-17 01:30:59 +02:00
|
|
|
|
|
|
|
# only process emails with a valid tracking ID? (throws away all other mail)
|
2022-07-12 12:34:19 +02:00
|
|
|
QUEUE_EMAIL_BOX_UPDATE_ONLY = getattr(
|
|
|
|
settings, 'QUEUE_EMAIL_BOX_UPDATE_ONLY', False)
|
2015-06-11 12:18:45 +02:00
|
|
|
|
|
|
|
# only allow users to access queues that they are members of?
|
2016-10-21 17:14:12 +02:00
|
|
|
HELPDESK_ENABLE_PER_QUEUE_STAFF_PERMISSION = getattr(
|
|
|
|
settings, 'HELPDESK_ENABLE_PER_QUEUE_STAFF_PERMISSION', False)
|
2018-10-15 02:23:28 +02:00
|
|
|
|
2019-07-04 10:32:49 +02:00
|
|
|
# use https in the email links
|
2022-07-12 12:34:19 +02:00
|
|
|
HELPDESK_USE_HTTPS_IN_EMAIL_LINK = getattr(
|
2023-09-03 01:07:43 +02:00
|
|
|
settings, 'HELPDESK_USE_HTTPS_IN_EMAIL_LINK', settings.SECURE_SSL_REDIRECT)
|
2020-12-02 01:21:56 +01:00
|
|
|
|
2023-11-15 01:41:56 +01:00
|
|
|
# Default to True for backwards compatibility
|
2023-11-15 12:31:45 +01:00
|
|
|
HELPDESK_TEAMS_MODE_ENABLED = getattr(settings, 'HELPDESK_TEAMS_MODE_ENABLED', True)
|
2023-11-15 01:41:56 +01:00
|
|
|
if HELPDESK_TEAMS_MODE_ENABLED:
|
|
|
|
HELPDESK_TEAMS_MODEL = getattr(
|
|
|
|
settings, 'HELPDESK_TEAMS_MODEL', 'pinax_teams.Team')
|
|
|
|
HELPDESK_TEAMS_MIGRATION_DEPENDENCIES = getattr(settings, 'HELPDESK_TEAMS_MIGRATION_DEPENDENCIES', [
|
2022-07-12 12:34:19 +02:00
|
|
|
('pinax_teams', '0004_auto_20170511_0856')])
|
2023-11-15 01:41:56 +01:00
|
|
|
HELPDESK_KBITEM_TEAM_GETTER = getattr(
|
|
|
|
settings, 'HELPDESK_KBITEM_TEAM_GETTER', lambda kbitem: kbitem.team)
|
|
|
|
else:
|
|
|
|
HELPDESK_TEAMS_MODEL = settings.AUTH_USER_MODEL
|
|
|
|
HELPDESK_TEAMS_MIGRATION_DEPENDENCIES = []
|
|
|
|
HELPDESK_KBITEM_TEAM_GETTER = lambda _: None
|
|
|
|
|
|
|
|
# show knowledgebase links?
|
|
|
|
# If Teams mode is enabled then it has to be on
|
|
|
|
HELPDESK_KB_ENABLED = True if HELPDESK_TEAMS_MODE_ENABLED else getattr(settings, 'HELPDESK_KB_ENABLED', True)
|
2021-08-04 16:19:14 +02:00
|
|
|
|
2021-04-13 14:04:08 +02:00
|
|
|
# Include all signatures and forwards in the first ticket message if set
|
2022-07-12 12:34:19 +02:00
|
|
|
# Useful if you get forwards dropped from them while they are useful part
|
|
|
|
# of request
|
|
|
|
HELPDESK_FULL_FIRST_MESSAGE_FROM_EMAIL = getattr(
|
|
|
|
settings, 'HELPDESK_FULL_FIRST_MESSAGE_FROM_EMAIL', False)
|
2021-04-13 14:04:08 +02:00
|
|
|
|
|
|
|
# If set then we always save incoming emails as .eml attachments
|
|
|
|
# which is quite noisy but very helpful for complicated markup, forwards and so on
|
|
|
|
# (which gets stripped/corrupted otherwise)
|
2022-07-12 12:34:19 +02:00
|
|
|
HELPDESK_ALWAYS_SAVE_INCOMING_EMAIL_MESSAGE = getattr(
|
|
|
|
settings, "HELPDESK_ALWAYS_SAVE_INCOMING_EMAIL_MESSAGE", False)
|
2023-04-15 14:11:41 +02:00
|
|
|
|
|
|
|
#######################
|
|
|
|
# email OAUTH #
|
|
|
|
#######################
|
|
|
|
|
2023-04-18 13:35:02 +02:00
|
|
|
HELPDESK_OAUTH = getattr(
|
|
|
|
settings, 'HELPDESK_OAUTH', {
|
|
|
|
"token_url": "",
|
|
|
|
"client_id": "",
|
|
|
|
"secret": "",
|
|
|
|
"scope": [""]
|
|
|
|
}
|
|
|
|
)
|
2023-04-19 12:07:43 +02:00
|
|
|
|
|
|
|
# Set Debug Logging Level for IMAP Services. Default to '0' for No Debugging
|
|
|
|
HELPDESK_IMAP_DEBUG_LEVEL = getattr(settings, 'HELPDESK_IMAP_DEBUG_LEVEL', 0)
|
2023-10-11 07:50:56 +02:00
|
|
|
|
|
|
|
#############################################
|
|
|
|
# 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)
|
2023-12-02 19:09:34 +01:00
|
|
|
|
2024-04-22 18:33:58 +02:00
|
|
|
HELPDESK_VALID_EXTENSIONS = getattr(settings, 'VALID_EXTENSIONS', None)
|
|
|
|
if HELPDESK_VALID_EXTENSIONS:
|
|
|
|
# Print to stderr
|
|
|
|
print("VALID_EXTENSIONS is deprecated, use HELPDESK_VALID_EXTENSIONS instead", file=sys.stderr)
|
|
|
|
else:
|
|
|
|
HELPDESK_VALID_EXTENSIONS = getattr(settings, 'HELPDESK_VALID_EXTENSIONS', ['.txt', '.asc', '.htm', '.html', '.pdf', '.doc', '.docx', '.odt', '.jpg', '.png', '.eml'])
|
2024-02-20 22:57:39 +01:00
|
|
|
|
|
|
|
HELPDESK_VALIDATE_ATTACHMENT_TYPES = getattr(settings, 'HELPDESK_VALIDATE_ATTACHMENT_TYPES', True)
|
|
|
|
|
2023-12-02 19:09:34 +01:00
|
|
|
def get_followup_webhook_urls():
|
|
|
|
urls = os.environ.get('HELPDESK_FOLLOWUP_WEBHOOK_URLS', None)
|
|
|
|
if urls:
|
2023-12-05 00:36:20 +01:00
|
|
|
return re.split(r'[\s],[\s]', urls)
|
2023-12-02 19:09:34 +01:00
|
|
|
|
|
|
|
HELPDESK_GET_FOLLOWUP_WEBHOOK_URLS = getattr(settings, 'HELPDESK_GET_FOLLOWUP_WEBHOOK_URLS', get_followup_webhook_urls)
|
|
|
|
|
|
|
|
def get_new_ticket_webhook_urls():
|
|
|
|
urls = os.environ.get('HELPDESK_NEW_TICKET_WEBHOOK_URLS', None)
|
|
|
|
if urls:
|
|
|
|
return urls.split(',')
|
|
|
|
|
|
|
|
HELPDESK_GET_NEW_TICKET_WEBHOOK_URLS = getattr(settings, 'HELPDESK_GET_NEW_TICKET_WEBHOOK_URLS', get_new_ticket_webhook_urls)
|
|
|
|
|
|
|
|
HELPDESK_WEBHOOK_TIMEOUT = getattr(settings, 'HELPDESK_WEBHOOK_TIMEOUT', 3)
|