setup: allow num2words >= 0.5.9 (#82017)
gitea/hobo/pipeline/head This commit looks good Details

This commit is contained in:
Frédéric Péters 2023-10-05 10:12:20 +02:00
parent 56bba71638
commit 39df6083ce
2 changed files with 3 additions and 2 deletions

View File

@ -57,7 +57,8 @@ def as_numeral_currency(number):
if not number:
return ''
try:
return num2words(unlazy(number), lang=get_language(), to='currency')
# workaround newer num2words always specifiying cents
return num2words(unlazy(number), lang=get_language(), to='currency').removesuffix(' et zéro centimes')
except (TypeError, ValueError, decimal.InvalidOperation):
return ''

View File

@ -156,7 +156,7 @@ setup(
'djangorestframework>=3.12, <3.14',
'dnspython',
'lxml',
'num2words==0.5.9',
'num2words>=0.5.9',
'sorl-thumbnail',
'Pillow',
],