Update ihatemoney/utils.py

Co-Authored-By: Glandos <bugs-github@antipoul.fr>
This commit is contained in:
Andrew Dickinson 2020-04-26 12:44:48 -04:00 committed by GitHub
parent 1497d2c666
commit 9d91eea6c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -320,12 +320,7 @@ def localize_list(list, surround_with_em=True):
middle = _("{previous_object}, {next_object}") middle = _("{previous_object}, {next_object}")
end = _("{previous_object}, and {end_object}") end = _("{previous_object}, and {end_object}")
item_wrapper = em_surround item_wrapper = em_surround if surround_with_em else lambda x: x
# fmt: off
if not surround_with_em:
def item_wrapper(x):
return x
# fmt: on
if len(list) == 1: if len(list) == 1:
return one.format(single_object=item_wrapper(list[0])) return one.format(single_object=item_wrapper(list[0]))