Skip to content
Snippets Groups Projects
Unverified Commit 4ed9e567 authored by Fredrik Jonsson's avatar Fredrik Jonsson Committed by GitHub
Browse files

Add back the source_type filter that was removed by mistake. (#4013)

Fixes #4012
parent 923f2e9a
No related branches found
No related tags found
1 merge request!98Merge 5.15.0 into ardc-main
......@@ -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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment