diff --git a/hypha/apply/activity/templatetags/activity_tags.py b/hypha/apply/activity/templatetags/activity_tags.py index 896a9289301c8bc86037977528cd9b6d11c68d66..83c283cbd7a59737d3f8154538bafc34ba4364a8 100644 --- a/hypha/apply/activity/templatetags/activity_tags.py +++ b/hypha/apply/activity/templatetags/activity_tags.py @@ -118,3 +118,18 @@ def visibility_display(visibility: str, user) -> str: return f"{visibility} + {team_string}" return visibility + + +@register.filter +def source_type(value) -> str: + """Formats source type + For a given source type containing "submission", this will be converted + to "Submission" (ie. "application submission" -> "Submission"). + Args: + value: the source type to be formatted + Returns: + A source type string with a capitalized first letter + """ + if value and "submission" in value: + return "Submission" + return str(value).capitalize()