I have this code of line that I need to be up and running.
<h4 class="page-header">
{% if msg.sent_by_id == request.user.public_id|string %}
{% if request.user.role == 'administrator' %}Admin Replied
{% elif request.user.role == 'user' %}Your reply
{% endif %}
{% endif %}
</h4>
The problem is that these two values are the same, BUT both of them are other format. msg.sent_by_id is a string, neither request.user.public_id, this value is in uuid format. What is the correct way of 'converting' an variable to a string and then comparing the two values?
str (uuid)in your view and pass the str version into your templatereturn render(request, 'service_desk/ticket_status.html', {'ticket': Ticket_obj, 'ticket_messages': Ticket_obj_messages})