Merge branch 'django-helpdesk:main' into BUG-1230-postgresql-version-django-missmatch

This commit is contained in:
David Vadnais 2025-03-11 08:13:54 -10:00 committed by GitHub
commit 88b23058e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 23 additions and 10 deletions

View File

@ -36,6 +36,10 @@ Before django-helpdesk will be much use, you need to do some basic configuration
This will run the escalation process hourly, using the 'Escalation Days' setting for each queue to determine which tickets to escalate.
To notify users of outstanding tickets without adding an entry to the ticket, use the `notify-only` flag. This will send the emails without creating a follow-up::
0 * * * * /path/to/helpdesksite/manage.py escalate_tickets --notify-only
5. If you wish to exclude some days (eg, weekends) from escalation calculations, enter the dates manually via the Admin, or setup a cronjob to run a management command on a regular basis::
0 0 * * 0 /path/to/helpdesksite/manage.py create_escalation_exclusions --days saturday sunday

View File

@ -33,9 +33,17 @@ class Command(BaseCommand):
default=False,
help='Display escalated tickets'
)
parser.add_argument(
'-n',
'--notify-only',
action='store_true',
default=False,
help='Send email reminder but dont escalate tickets'
)
def handle(self, *args, **options):
verbose = options['escalate_verbosely']
notify_only = options['notify_only']
queue_slugs = options['queues']
# Only include queues with escalation configured
@ -87,14 +95,15 @@ class Command(BaseCommand):
if verbose:
self.stdout.write(f" - Esclating {ticket.ticket} from {ticket.priority + 1}>{ticket.priority}")
followup = ticket.followup_set.create(
title=_('Ticket Escalated'),
public=True,
comment=_('Ticket escalated after %(nb)s days') % {'nb': queue.escalate_days},
)
if not notify_only:
followup = ticket.followup_set.create(
title=_('Ticket Escalated'),
public=True,
comment=_('Ticket escalated after %(nb)s days') % {'nb': queue.escalate_days},
)
followup.ticketchange_set.create(
field=_('Priority'),
old_value=ticket.priority + 1,
new_value=ticket.priority,
)
followup.ticketchange_set.create(
field=_('Priority'),
old_value=ticket.priority + 1,
new_value=ticket.priority,
)