From 40ef247844b471ab5674ef8b43ed34b8053b5050 Mon Sep 17 00:00:00 2001 From: Sam Splunks <72095718+samsplunks@users.noreply.github.com> Date: Mon, 5 Feb 2024 11:39:45 +0100 Subject: [PATCH] Handle "no label" for status id case (shouldn't happen) --- helpdesk/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpdesk/models.py b/helpdesk/models.py index 620cb54d..b585f9ea 100644 --- a/helpdesk/models.py +++ b/helpdesk/models.py @@ -719,14 +719,14 @@ class Ticket(models.Model): if status_id_list: # keep defined statuses in order and add labels for display status_dict = dict(helpdesk_settings.TICKET_STATUS_CHOICES) - new_statuses = [(status_id, status_dict.get(status_id, 1)) + new_statuses = [(status_id, status_dict.get(status_id, _('No label'))) for status_id in status_id_list] else: # defaults to all choices if status was not mapped new_statuses = helpdesk_settings.TICKET_STATUS_CHOICES return new_statuses get_allowed_status_flow = property(_get_allowed_status_flow) - + def _get_ticket_url(self): """ Returns a publicly-viewable URL for this ticket, used when giving