diff --git a/helpdesk/templates/helpdesk/public_view_ticket.html b/helpdesk/templates/helpdesk/public_view_ticket.html
index 3c3467a7..62f37a43 100644
--- a/helpdesk/templates/helpdesk/public_view_ticket.html
+++ b/helpdesk/templates/helpdesk/public_view_ticket.html
@@ -110,19 +110,9 @@
{% else %}
- {% for status_choice in ticket.STATUS_CHOICES %}
- {% with status_choice_strfmt_s=status_choice.0|stringformat:"s" %}
- {% if ticket.status == 2 and status_choice_strfmt_s in "1" %}{% else %}
- {% if ticket.status == 3 and status_choice_strfmt_s not in "2,3,4" %}{% else %}
- {% if ticket.status == 4 and status_choice_strfmt_s not in "2,4" %}{% else %}
- {% if ticket.status == 5 and status_choice_strfmt_s not in "2,5" %}{% else %}
-
- {% endif %}
- {% endif %}
- {% endif %}
- {% endif %}
- {% endwith %}
- {% endfor %}
+ {% for status_choice in ticket.get_allowed_status_flow %}
+
+ {% endfor %}
{% endif %}
diff --git a/helpdesk/templates/helpdesk/ticket.html b/helpdesk/templates/helpdesk/ticket.html
index 50a61a4f..b4eb61db 100644
--- a/helpdesk/templates/helpdesk/ticket.html
+++ b/helpdesk/templates/helpdesk/ticket.html
@@ -110,20 +110,8 @@
{% if not ticket.can_be_resolved %}{% trans "This ticket cannot be resolved or closed until the tickets it depends on are resolved." %}{% endif %}
- {% for status_choice in ticket.STATUS_CHOICES %}
- {% with status_choice_strfmt_s=status_choice.0|stringformat:"s" %}
- {% if ticket.status == 1 and status_choice_strfmt_s in "2" %}{% else %}
- {% if ticket.status == 2 and status_choice_strfmt_s in "1" %}{% else %}
- {% if ticket.status == 3 and status_choice_strfmt_s not in "2,3,4" %}{% else %}
- {% if ticket.status == 4 and status_choice_strfmt_s not in "2,4" %}{% else %}
- {% if ticket.status == 5 and status_choice_strfmt_s not in "2,5" %}{% else %}
-
- {% endif %}
- {% endif %}
- {% endif %}
- {% endif %}
- {% endif %}
- {% endwith %}
+ {% for status_choice in ticket.get_allowed_status_flow %}
+
{% endfor %}