Handle "no label" for status id case (shouldn't happen)

This commit is contained in:
Sam Splunks 2024-02-05 11:39:45 +01:00 committed by GitHub
parent c7a9a1ab54
commit 40ef247844
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -719,7 +719,7 @@ class Ticket(models.Model):
if status_id_list: if status_id_list:
# keep defined statuses in order and add labels for display # keep defined statuses in order and add labels for display
status_dict = dict(helpdesk_settings.TICKET_STATUS_CHOICES) 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] for status_id in status_id_list]
else: else:
# defaults to all choices if status was not mapped # defaults to all choices if status was not mapped