Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion care/facility/templatetags/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def suggestion_string(suggestion_code: str):

@register.filter()
def field_name_to_label(value):
return value.replace("_", " ").capitalize()
if value:
return value.replace("_", " ").capitalize()


@register.filter(expects_localtime=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ <h3 class="text-lg text-gray-900">
<span class="text-sm text-gray-500">Address:</span> {{patient.address}}
</p>
<p class="flex-grow">
<span class="text-sm text-gray-500">Ration Card Category:</span> {{patient.get_ration_card_category_display|field_name_to_label}}
<span class="text-sm text-gray-500">Ration Card Category:</span> {{patient.get_ration_card_category_display}}
</p>
</div>
</div>
Expand Down