Skip to content

Commit

Permalink
Merge pull request #78 from UKHSA-Internal/allow_None_value_for_plura…
Browse files Browse the repository at this point in the history
…lise_function

allow 'number' to be None - test if this resolve the Easy Read issue
  • Loading branch information
jaro-m authored Aug 6, 2023
2 parents 24965eb + a4d4670 commit d2e8d38
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/template_processor/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from pytz import timezone

# Internal:
# Internal:
from ..config import Settings
from .types import DataItem
from ..common.utils import get_release_timestamp
Expand Down Expand Up @@ -233,10 +233,10 @@ def as_date(latest_timestamp: str) -> str:

@as_template_filter
def pluralise(number, singular, plural, null=str()):
if abs(number) > 1:
if number and abs(number) > 1:
return plural

if abs(number) == 1:
if number and abs(number) == 1:
return singular

if number == 0 and not len(null):
Expand Down

0 comments on commit d2e8d38

Please sign in to comment.